Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Save a file
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
HazySmoke)345




PostPosted: Mon Feb 27, 2006 8:31 pm   Post subject: Save a file

I'm just wondering how to create/save a file with visual basic. I have no idea how to start. What I'm trying to do now is that I want to create a file at C:\ called "testing.dat" and write the following text:
code:
1
12
123
1234

Since I never tried to create a file, I have no idea how to do it... anyone knows the syntax for it?
Sponsor
Sponsor
Sponsor
sponsor
cool dude




PostPosted: Tue Feb 28, 2006 5:59 pm   Post subject: (No subject)

Private Sub Form_Load()
Open "c:/filename" For Output As #1
Write #1, "1" + "2"
End Sub

i think thats wat u want. the open for output creates the file and the write statement writes watever u want in the file
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: