Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

can you convert this from VB6 to .net form? i have no clue what to change?

 

Private Sub img1_click()

Dim ifilenum As Integer

ifilenum = FreeFile

Open App.Path & "\myfile.txt" For Output As ifilenum

Print #ifilenum, Txt1.Text

Print #ifilenum, txt2.Text

Close ifilenum

End Sub

 

 

Private Sub lblsign_Click()

Dim ifilenum As Integer

ifilenum = FreeFile

Open App.Path & "\myfile.txt" For Output As ifilenum

Print #ifilenum, Txt1.Text

Print #ifilenum, txt2.Text

Close ifilenum

MsgBox "WAHAHAHA testing!.", vbCritical, "WARNING!"

End Sub

Posted

Whenever you have Visual Basic 6.0 code and you want to change it to .NET, it is better to place it in a Visual Basic 6 project and then apply the upgrade wizard from within Visual Studio .NET

 

Hope this helps,

Dream as if you'll live forever, live as if you'll die today
  • *Experts*
Posted

Upgrade wizard is never the best thing to use.

 

For writing to a file, look into the System.IO.StreamWriter class. Then use its WriteLine or Write methods to write to the file. Also, don't forget to use the Flush and Close method to make sure everything is written to the file.

Posted

Simple, VB6 to .NET wizard is not that good, I think a good start for you will be start reading about tha changes in Visual Basic (from 6 to .NET), also if you never used OOP will be a good time too to start reading about it.

If you know what you did in VB6 (the code you posted) after reading a few references on the .NET library you'll be able to upgrade your code

Fat kids are harder to kidnap

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...