Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Convert FileOpen in .net

Convert FileOpen in .net

Scheduled Pinned Locked Moved Visual Basic
csharphelpcareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    soniasan
    wrote on last edited by
    #1

    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.

    P T 2 Replies Last reply
    0
    • S soniasan

      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.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • S soniasan

        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.

        T Offline
        T Offline
        Tom John
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups