Wednesday, 14 March 2012

vb.net create a directory?


In this tutorial you can learn how to create a directory using vb.net.
Syntax:
First you have to import system.io then
Directory.createdirectory(dir path)
Dir pathà where you want to create directory path
Ex:”c:\newtest “
To do this event following steps should follow if you know ignore these steps
Step1:
Drag and drop button1, label1, 2,textbox1
Label1àenter the path
Labelàeg:c:\newfolder
Double click the button and copy and paste the following code
Code:
Imports System.IO

Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        Directory.CreateDirectory(TextBox1.Text)
    End Sub
End Class

Output:



No comments:

Post a Comment