Dim consql As String = "Data Source=TCJSRVDB02;Initial Catalog=BussinessApplication;User ID=sa"
Dim connection As New SqlConnection(consql)
If connection.State = ConnectionState.Closed Then
connection.Open()
End If
Dim constr As String = ""
Dim savefolder As String = "R:\MRD\image\"
Dim strFullPath As String = savefolder
Dim dlg As New OpenFileDialog()
If dlg.ShowDialog() = DialogResult.OK Then
'*** Create Folder
If Not Directory.Exists(strFullPath) Then
Directory.CreateDirectory(strFullPath)
End If
If connection.State = ConnectionState.Closed Then
connection.Open()
End If
'*** Save File
Dim filePath As String = dlg.FileName
Dim fileName As String = Path.GetFileName(filePath)
File.Copy(filePath, savefolder & fileName, True)