|
楼主 |
发表于 2017-10-24 21:25:09
|
显示全部楼层
看不懂的以下可不看。为了大家我VB都学了,等我升天了大家一定要给我烧点钱啊(笑哭)
现在...研究如何转换乱码。
可能是编码的问题吧...
啊...真心是醉了...
尝试把文本编码转换一下:Big5->GB2312的方式并不抱有希望...因为Big5是繁体字的代码嘛。
现在先试试Shift-JIS ->GB2312吧。
...从网上找来的一串代码
- Private Sub Form_OLEDragDrop(data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
- Call J2C(data.Files(1), "Shift-JIS", "GB2312")
- End Sub
- Private Function J2C(FilePath1, charset1, charset2)
- Dim str, adostream, i As Long
- str = ""
- Set adostream = CreateObject("ADODB.Stream")
- With adostream
- .Type = 2
- .Open
- .Charset = charset1
- .Position = 0
- .LoadFromFile FilePath1
- str = .readtext
- .Close
- End With
- Set adostream = Nothing
- Set adostream = CreateObject("ADODB.Stream")
- With adostream
- .Type = 2
- .Open
- .Charset = charset2
- .Position = 0
- .writetext str
- .flush
- .Close
- End With
- Set adostream = Nothing
- Dim StrJa
- StrJa = Split(str, Chr(13) & Chr(10))
- Me.Cls
- For i = 0 To UBound(StrJa)
- Print " " & StrJa(i)
- Next
- End Function
复制代码
这个就是可以转换编码的VB代码了...VB...VB...
卧槽VB代码啊!
...没办法,现在正在安装MSVB中 |
|