hakari Posted December 3, 2003 Posted December 3, 2003 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 Quote
Mehyar Posted December 3, 2003 Posted December 3, 2003 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, Quote Dream as if you'll live forever, live as if you'll die today
*Experts* mutant Posted December 3, 2003 *Experts* Posted December 3, 2003 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. Quote
hakari Posted December 4, 2003 Author Posted December 4, 2003 i dont know what that means or how to do it. can you help me? Quote
iebidan Posted December 4, 2003 Posted December 4, 2003 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 Quote Fat kids are harder to kidnap
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.