Search the web
Sign In
New User? Sign Up
codesnips · Code Snippets
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Create a File (Sequential)   Message List  
Reply | Forward Message #19 of 48 |
It is assumed that you have already placed these 2 controls on your winform:
1: TextBox (txt_data)
2: Button (btn_save)
 
Now create an on_click method for btn_save
 
'//////////////////////////////////////////////////////////////

Private Sub btn_save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_save.Click

'Create a text file, and save contents of the textbox (txt_data.text) into the file

Dim output As FileStream

Dim filechooser As New SaveFileDialog()

Dim result As DialogResult = filechooser.ShowDialog

Dim filename As String

filechooser.CheckFileExists = False

If result = DialogResult.Cancel Then

Exit Sub

End If

filename = filechooser.FileName

output = New FileStream(filename, FileMode.Create, FileAccess.Write)

Dim data As [Byte]() = Encoding.ASCII.GetBytes(txt_data.Text)

output.Write(data, 0, data.Length)

output.Flush()

output = Nothing

End Sub

'//////////////////////////////////////////////////////////////



Mon Dec 2, 2002 8:38 pm

asimletters
Online Now Online Now
Send Email Send Email

Forward
Message #19 of 48 |
Expand Messages Author Sort by Date

It is assumed that you have already placed these 2 controls on your winform: 1: TextBox (txt_data) 2: Button (btn_save) Now create an on_click method for...
Asim
asimletters
Online Now Send Email
Dec 2, 2002
8:37 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help