Computer Science Canada Saving Directories and File Folders |
Author: | Kensui [ 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! |
Author: | z_cross_fire [ 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 ![]() EDIT: Here's something for directories; http://www.techotopia.com/index.php/Working_with_Directories_in_Visual_Basic |