Saving Directories and File Folders
Author |
Message |
Kensui
|
Posted: 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
|
|
|
z_cross_fire
|
|
|
|
|
|
|