Private Function kTSaveFile(ByVal strFileName As String)
Try
Dim path As String = strFileName(文件路径动态取得)
Dim path2 As String = "C:/kt_backup/33.txt"
If path = "" Then
MessageBox.Show("file is not exist")
Exit Function
End If
If System.IO.File.Exists(path2) Then
If MessageBox.Show("file is exist,replace it?", "", MessageBoxButtons.OKCancel) = DialogResult.OK Then
System.IO.File.Delete(path2)
System.IO.File.Copy(path, path2)
MessageBox.Show("ファイルの保存を実行しました。")
Else
MessageBox.Show("該当ファイルが存在しました。")
Exit Function
End If
End If
Catch ex As Exception
MessageBox.Show("ファイルの保存を実行できませんでした。")
End Try
End Function
Try
Dim path As String = strFileName(文件路径动态取得)
Dim path2 As String = "C:/kt_backup/33.txt"
If path = "" Then
MessageBox.Show("file is not exist")
Exit Function
End If
If System.IO.File.Exists(path2) Then
If MessageBox.Show("file is exist,replace it?", "", MessageBoxButtons.OKCancel) = DialogResult.OK Then
System.IO.File.Delete(path2)
System.IO.File.Copy(path, path2)
MessageBox.Show("ファイルの保存を実行しました。")
Else
MessageBox.Show("該当ファイルが存在しました。")
Exit Function
End If
End If
Catch ex As Exception
MessageBox.Show("ファイルの保存を実行できませんでした。")
End Try
End Function