metalheart
14-08-2004, 06:11
Tôi có đoạn code sau:
Dim strPath As String = "c:\dangkybai"
Dim strFile As String = "\dangky.txt\"
If Directory.Exists(strPath) Then
'if file exists
If File.Exists(strPath & strFile) Then
File.Delete(strPath & strFile)
End If
Else
'Create folder
Directory.CreateDirectory(strPath)
End If
'create new file
Dim strmWrite As StreamWriter
strmWrite = File.CreateText(strPath & strFile)
strmWrite.WriteLine(strContent)
strmWrite.Close()
Khi chạy trên một máy client, muốn write ra 1 file hay 1 thư mục thì nó toàn khởi tạo trên máy server. Vậy làm thế nào để nó khởi tạo ngay trên máy client.
Dim strPath As String = "c:\dangkybai"
Dim strFile As String = "\dangky.txt\"
If Directory.Exists(strPath) Then
'if file exists
If File.Exists(strPath & strFile) Then
File.Delete(strPath & strFile)
End If
Else
'Create folder
Directory.CreateDirectory(strPath)
End If
'create new file
Dim strmWrite As StreamWriter
strmWrite = File.CreateText(strPath & strFile)
strmWrite.WriteLine(strContent)
strmWrite.Close()
Khi chạy trên một máy client, muốn write ra 1 file hay 1 thư mục thì nó toàn khởi tạo trên máy server. Vậy làm thế nào để nó khởi tạo ngay trên máy client.