Page 1 of 1

vb.net and modules

Posted: 10 Jun 2009, 07:39
by geraldhum
Hi

I am using vb.net 2005 pro

I am busy writing this app for our company. something that will just create folders and files so it doesn't have to be doesn't manuely.

Would i would like to do is create a modul and then in a form i would just call up that module to create the directory. I know how to create a dirctory in vb.net but..i would like to do something like this. I have a textbox and in that textbox we would enter in the file name. so in the button code i would call up the routing from the module an have it like this.

CreateDiretory(Path, name)

where creata directory would be my function

Can anyone please help me with this.

Re: vb.net and modules

Posted: 10 Jun 2009, 07:43
by c0d3r
*Deleted*

I can't read the first time round.

Re: vb.net and modules

Posted: 10 Jun 2009, 08:37
by rustypup
i'm no vb fundi, but surely this is a standard method in the File API?...

Re: vb.net and modules

Posted: 10 Jun 2009, 09:17
by geraldhum
sorry guys, i never explained good at all.

but anyway i got it write and this is all i did.

Public Sub CreateDirectory(ByVal path As String)
Try
Directory.CreateDirectory(path)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub