hi guys... i new person using vb.net
i have some problem in copy a file into specific directory create by user...
below is coding that write that may help u all to solve my problem
[code=vbnet]
Imports System.IO
Public Class Form1
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Dim filePath As String
Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button3.Click
End
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button2.Click
TextBox1.Text = ""
ComboBox1.Text = ""
TextBox2.Text = ""
TextBox1.Focus( )
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim souFile As String = TextBox2.Text
Dim desFile = TextBox1.Text
Dim result As StreamWriter
'dirCopy = TextBox2.Text
Try
If TextBox1.Text = "" And ComboBox1.Text = "" And TextBox1.Text = "" Then
MsgBox("sorry", MsgBoxStyle.OKO nly, "Alert")
Else
Directory.Creat eDirectory("C:\ Documents and Settings\Crazy_ Frog\My Documents\Visua l Studio Projects\Create Path\Document" & "\" & ComboBox1.Text & "\" & TextBox1.Text)
File.Copy(TextB ox1.Text, TextBox2.Text)
MsgBox("File copy successful", MsgBoxStyle.Inf ormation, "Informatio n")
End If
Catch ex As Exception
MsgBox("File copy successful", MsgBoxStyle.Inf ormation, "Informatio n")
End Try
End Sub
Private Sub Button4_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button4.Click
OpenFileDialog1 .ShowDialog()
filePath = OpenFileDialog1 .FileName
TextBox2.Text = filePath
End Sub
End Class
[/code]
please help me... urgent...
i have some problem in copy a file into specific directory create by user...
below is coding that write that may help u all to solve my problem
[code=vbnet]
Imports System.IO
Public Class Form1
Inherits System.Windows. Forms.Form
#Region " Windows Form Designer generated code "
#End Region
Dim filePath As String
Private Sub Button3_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button3.Click
End
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button2.Click
TextBox1.Text = ""
ComboBox1.Text = ""
TextBox2.Text = ""
TextBox1.Focus( )
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim souFile As String = TextBox2.Text
Dim desFile = TextBox1.Text
Dim result As StreamWriter
'dirCopy = TextBox2.Text
Try
If TextBox1.Text = "" And ComboBox1.Text = "" And TextBox1.Text = "" Then
MsgBox("sorry", MsgBoxStyle.OKO nly, "Alert")
Else
Directory.Creat eDirectory("C:\ Documents and Settings\Crazy_ Frog\My Documents\Visua l Studio Projects\Create Path\Document" & "\" & ComboBox1.Text & "\" & TextBox1.Text)
File.Copy(TextB ox1.Text, TextBox2.Text)
MsgBox("File copy successful", MsgBoxStyle.Inf ormation, "Informatio n")
End If
Catch ex As Exception
MsgBox("File copy successful", MsgBoxStyle.Inf ormation, "Informatio n")
End Try
End Sub
Private Sub Button4_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button4.Click
OpenFileDialog1 .ShowDialog()
filePath = OpenFileDialog1 .FileName
TextBox2.Text = filePath
End Sub
End Class
[/code]
please help me... urgent...
Comment