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

Username:   Password: 
 RegisterRegister   
 Saving Directories and File Folders
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
Kensui




PostPosted: Thu Apr 21, 2011 10:01 am   Post subject: Saving Directories and File Folders

I have a program right now that I need to create specific folders at times to save data. How would I create them in Visual Studio 2008?

This is what I have so far:

Imports System.IO
Public Class Form1
Const FILE_NAME As String = "empty.txt"


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim testfile As New FileInfo(FILE_NAME)
Dim name As String = TimeOfDay.Hour
Dim name2 As String = TimeOfDay.Minute
If Not testfile.Exists Then
testfile.Create()
MessageBox.Show("created")
My.Computer.FileSystem.WriteAllText("C:\" & name & "\" & name2 & ".txt", TextBox1.Text, True)

Else
MessageBox.Show(testfile.FullName & "exists")
End If

End Sub
End Class

Any help would be appreciated. Thanks!
Sponsor
Sponsor
Sponsor
sponsor
z_cross_fire




PostPosted: Fri Apr 22, 2011 11:43 pm   Post subject: RE:Saving Directories and File Folders

I don't quite understand what you want. Do you need help with how directories are handled, or files?
However, here is something that may help you with files;
http://www.techrepublic.com/article/read-and-write-text-files-with-visual-basic-net/1045309

Good Luck Very Happy

EDIT:
Here's something for directories;
http://www.techotopia.com/index.php/Working_with_Directories_in_Visual_Basic
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: