Need help with io create directory

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

Need help with io create directory
pip
Hello i am in need of assistance with very easy problem i can't solve
i am trying to make it create a directory on form load to desktop to make new folder and this is code i have or tried
Code: Select all
Imports System.IO
Public Class frmlogin
    Private Sub frmlogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Directory.CreateDirectory("c:\" & System.Environment.UserName \ "desktop")
    End Sub
End Class

ehh many fails i am trying to make it make a folder named info onto desktop yea i am kind of tired so the code is an example to show what i am trying to attempt idoit;
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
User avatar
Dummy1912
VIP - Donator
VIP - Donator
Posts: 1969
Joined: Sat Aug 21, 2010 2:17 pm

hi pip

hope this helps
Code: Select all
Imports System.IO
Public Class frmlogin
    Private Sub frmlogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        My.Computer.FileSystem.CreateDirectory(My.Computer.FileSystem.SpecialDirectories.Desktop & "\" & "Info" & "\")
    End Sub
End Class
visit us on:


http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
User avatar
pip
VIP - Donator
VIP - Donator
Posts: 156
Joined: Tue Jul 12, 2011 3:13 am

Re: Need help with io create directory
pip
Dummy1912 wrote:
hi pip

hope this helps
Code: Select all
Imports System.IO
Public Class frmlogin
    Private Sub frmlogin_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        My.Computer.FileSystem.CreateDirectory(My.Computer.FileSystem.SpecialDirectories.Desktop & "\" & "Info" & "\")
    End Sub
End Class

Thanks alot dummy :)! +rep mate
<a href="http://www.points2shop.com/s/xbox_point ... 5082"><img src="http://points2shop.com/images/promotion ... ricoxg.gif" border="0"/></a>
3 posts Page 1 of 1
Return to “Coding Help & Support”