Tuesday, May 19, 2009

Create Folder on Specific Path

Dear Friends
In this article we will see how to create a Folder on a specific Location using vb.net Code......

Method 1
STEP 1: Create on Console based Application.

STEP 2: Paste the following Code

Imports System.IO
Module Module1

Sub Main()
Dim di As DirectoryInfo = New DirectoryInfo("D:\MyDir")
' Determine whether the directory exists.
If di.Exists Then
' Indicate that it already exists.
Console.WriteLine("Directory already Present")
Console.ReadLine()
Else
' Try to create the directory.
di.Create()

End If
End Sub

End Module

Metod 2
Method 1
STEP 1: Create on Console based Application.

STEP 2: Paste the following Code

Imports System.IO
Module Module1
Sub Main()
'System.IO.Directory.CreateDirectory("D:\MyDirector")
End Sub

End Module

No comments: