我写的FTP上传程序上传只有数字的文本文件,上传成功后,里面格式不变,但只要有汉字在里面,上传后的文件格式就乱了,还有乱码,里面的内容也有的无故丢失,这该怎么办啊,急急急!
解决方案 »
- 我想将string变量 a的值传递给水晶报表,在报表中显示a的值,应该怎么做呢? 在线等. (环境:vb6 + 水晶报表9.2)
- 求取读取数据方法,谢谢!!!
- 数据库数据如何响应焦点并显示?
- [在线求助]公司需求我建一个人事,考勤,工资的程序
- ◆◆◆哪们 XDJM 能给一份软件开发文档的模板呀?感谢不激!!!◆◆◆
- 在下写的一个绚丽多彩的3D花篮,现在公布源代码,希望和大家共同切磋交流:)
- ADO如何打开带密码的数据库
- 如何一次性修改控件数组名
- 跪求如何删除指定网站的COOKIE或者跳过某个网站的COOKIE或者使他COOKIE马上失效
- 问一个word问题
- 怎么用ado连接Access97和更低版本Access的数据库?!
- vb打包时,这个文件(MDAC_TYP.EXE)是不是一定要?这个文件好大啊
Dim Cnt As Long, nFileLen As Long, nRet As Long, nTotFileLen As Long
Dim sBuffer As String * 1024
Dim Ret As Long, SentBytes As Long, sAllBytes As Long, z As Long
Dim i As Integer, StartT As Long
Dim Kam As String, Ode As StringDim strPath As String
strPath = strSourcePlace
g_Klic = strPlaceOfUpOde = strPath & strFileName '源文件
Kam = g_Klic & strFileName '目标文件
txtInfo.SelText = Time & " > 开始文件传送..." & vbCrLf & " > 上传来源: " & Ode & ", 到: " & Kam & vbCrLf
txtInfo.SelText = Time & "> 正在上传文件资料...等待中" & vbCrLfhFile = FtpOpenFile(g_server, Kam, GENERIC_WRITE, FTP_TRANSFER_TYPE_BINARY, 0)
If hFile = 0 Then
MsgBox "不能在服务器上创建文件", vbExclamation, App.Title
txtInfo.SelText = Time & " > 不能在服务器上创建文件! 要求中止!" & vbCrLf
Unload Me
End IfSentBytes = 0
nFileLen = 0
StartT = GetTickCountOpen Ode For Binary As #1
nTotFileLen = LOF(1)
Do
Get #1, , sBuffer
If nFileLen < nTotFileLen - sReadBuffer Then
If InternetWriteFile(hFile, sBuffer, sReadBuffer, nRet) = 0 Then
MsgBox "Nastala chyba p鴌 p鴈vodu dat!", vbExclamation, App.Title
txtInfo.SelText = Time & " > Nastala chyba p鴌 p鴈vodu dat! Po瀉davek stornov醤!" & vbCrLf
Exit Do
End If
nFileLen = nFileLen + sReadBuffer
Else
If InternetWriteFile(hFile, sBuffer, nTotFileLen - nFileLen, nRet) = 0 Then
MsgBox "Nastala chyba p鴌 p鴈vodu dat!", vbExclamation, App.Title
txtInfo.SelText = Time & " > Nastala chyba p鴌 p鴈vodu dat! Po瀉davek stornov醤!" & vbCrLf
Exit Do
End If
nFileLen = nTotFileLen
End If
Loop Until nFileLen >= nTotFileLen
Close
InternetCloseHandle hFile
txtInfo.SelText = Time & " > 文件传送完毕" & vbCrLf
'移走文件
'Call MoveFile
'MsgBox "文件传送完毕.", vbInformation
'Unload Me
End Sub