Showing posts with label directory. Show all posts
Showing posts with label directory. Show all posts

Wednesday, 14 March 2012

vb.net move a directory in ?


How to move a directory in vb.net?

In this tutorial you can learn how to move a directory (move directory one place to another place), move content directory to another directory using vb.net.

Syntax:
First you have to import system.io then

Directory.move(source_path,destination_path )

Source_path: which directory should move that path?
Destination_path: where the path should keep

  Ex:”c:\newtest “,c:\newfolder1\new  move the content in newtest  to new directory

To do this event following steps should follow if you know ignore these steps

Step1:
Drag and drop button1, label1, 2, textbox1, 2
Button1àcheck
Label1àenter the path
Labelàeg:c:\newfolder

Step2:
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.Move(TextBox1.Text, TextBox2.Text)
    End Sub
End Class



Optput:


vb.net check a directory exits or not?


How to check a directory exits or not in vb.net?
In this tutorial you can learn how to check a directory exits or not (to check whether the directory is there or not)using vb.net.
Syntax:
First you have to import system.io then
Directory.exits(dir path) As Boolean
Dir pathà where the directory path is and output is true or false
Ex:”c:\newtest “ if this directory exits then written true or else false
To do this event following steps should follow if you know ignore these steps
Step1:
Drag and drop button1, label1, 2,textbox1
Button1àcheck
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
        If Directory.Exists(TextBox1.Text) = True Then
            MessageBox.Show("Directory already created")
        Else
            MessageBox.Show("Directory  is not there")
        End If

    End Sub
End Class


Optput:


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: