VB.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply

determine if Directory exists, create it if not Problem ( new to Visualbasics and dont know how to say it) Rate Topic: -----

#1 Kanchu  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 07-January 09


Dream Kudos: 0

Share |

determine if Directory exists, create it if not

Posted 07 January 2009 - 03:40 AM

Hello,

Ive recently got involved into programming.
A friend of mine told me VB 6.0 would be the best way to start.
I watched all sorts of tutorials and i now understand the very basics of visual basics.

I wanted to create a login system that would have 3 tabs 1 for regular login,
1 for admin login and 1 for account creation.
So far so good.
It saves the accounts by saving them in a .urs file in the map called /Users/.
However when this map does not exist it will show a error.
I would want to know what code or so to put into the form_load which will make my program create the map /Users/ if it does not exist.
As im not familiar with all the codes and stuff.
The only thing i can come up with is

 Mkdir "/Users/" 


but then ofcourse it would create the folder users everytime i start the program.
Please not i was still "Hello Worlding" a few days ago, so i really am unfamiliar with any sort of high-skilled programming which i probably dont understand.

Thank you for your time,
Kanchu
Was This Post Helpful? 0
  • +
  • -


#2 dklingman  Icon User is offline

  • D.I.C Regular
  • Icon

Reputation: 33
  • View blog
  • Posts: 261
  • Joined: 23-December 08


Dream Kudos: 0

Re: determine if Directory exists, create it if not

Posted 07 January 2009 - 04:34 AM

i'm not sure why your starting with vb 6 and i'm not saying it's a bad thing because that's how i started. however, you really should start with the .net framework let it be vb.net or c#. vb.net will definitely be the easier of the two because you don't have to worry about open and closing braces or semi-colons. plus since you can download a free version of vb.net or c# called vb.net express or c# express.

another thing not to discourage you with the tabbed login feature, but any login system has one way to login. it's a matter of setting up roles and permissions for users. i understand that you're just starting out but you don't want to develop bad habits.

however to help you out you will want to add a reference to the Scripting runtime or scrrun.dll then for your code

Dim directory As New Scripting.FileSystemObject
If Not directory.FolderExists("YOUR PATH") Then
	 directory.CreateFolder ("YOUR PATH")
End If
Set directory = Nothing


This post has been edited by dklingman: 07 January 2009 - 04:35 AM

Was This Post Helpful? 0
  • +
  • -

#3 Jayman  Icon User is offline

  • Student of Life
  • Icon

Reputation: 345
  • View blog
  • Posts: 9,235
  • Joined: 26-December 05


Dream Kudos: 500

Expert In: Everything

Re: determine if Directory exists, create it if not

Posted 07 January 2009 - 08:57 AM

Modified title to be more descriptive of the problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1
  • You cannot start a new topic
  • Reply Reply


Fast Reply

  

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users