Convert FileOpen in .net
-
Public Sub log_error(ByRef msg As String) If g_Trace = 1 Then On Error Resume Next FileOpen(255, VB6.GetPath & "\err.log", OpenMode.Append) PrintLine(255, msg & " " & Today & " " & TimeOfDay) FileClose(255) End Sub
Please tell me how i will convert this code into vb.net..... I will be very much Thankful. -
Public Sub log_error(ByRef msg As String) If g_Trace = 1 Then On Error Resume Next FileOpen(255, VB6.GetPath & "\err.log", OpenMode.Append) PrintLine(255, msg & " " & Today & " " & TimeOfDay) FileClose(255) End Sub
Please tell me how i will convert this code into vb.net..... I will be very much Thankful.soniasan wrote:
how i will convert this code into vb.net.....
Meet my friend, google.com[^]....
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Public Sub log_error(ByRef msg As String) If g_Trace = 1 Then On Error Resume Next FileOpen(255, VB6.GetPath & "\err.log", OpenMode.Append) PrintLine(255, msg & " " & Today & " " & TimeOfDay) FileClose(255) End Sub
Please tell me how i will convert this code into vb.net..... I will be very much Thankful.Public Sub LogError(ByVal message As String) Dim filename As String = System.IO.Path.Combine(Environment.CurrentDirectory, "err.log") Using writer As System.IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(filename, True) writer.WriteLine(message & Date.Now.ToString(" dd.MM.yy HH:mm:ss")) End Using End Sub
Hope this helps Tom