Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 15th, 2005, 01:14 PM
Registered User
Join Date: Sep 2005
Location: columbus, ohio, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help

I need to know how this is done in vb.net,thanks

On Error Resume Next
    Dim f As Integer
    f = FreeFile
    Open App.Path & "\Errors.log" For Append As #f
    Print #f, Format(Now, "mm/dd/yyyy") & " " & Format(Now, "hh:nn:ss") & " - "; p_sError
    Close #f

    If p_bDisplay Then
        MsgBox p_sError, vbCritical + vbApplicationModal
End If
Reply With Quote
  #2 (permalink)  
Old September 19th, 2005, 11:00 AM
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

    On Error Resume Next

    ' True (below) = Append.  Will create if file does not exist.
    Dim SW As New StreamWriter(App.Path & "\Errors.log", True)

    SW.WriteLine(Format(Now, "mm/dd/yyyy") & " " & _
                        Format(Now, "hh:nn:ss") & " - " & _

    SW = Nothing

    . . .

(App.Path might need to be changed. I don't believe that will work in .NET; not sure though.)
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

All times are GMT -4. The time now is 08:09 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.