vb中怎样把一个文本里面的十进制转化为二进制存到另一个文本中?谢谢!
小弟刚进来,分数少了点!:)PrivateSubCommand1_Click()DimiAsDoublei=1DimkAsIntegerDimlAsIntegerDima...
小弟刚进来,分数少了点!:)
Private Sub Command1_Click()
Dim i As Double
i = 1
Dim k As Integer
Dim l As Integer
Dim ayy(7) As Single
Dim str As String
Dim paths As String
Dim paths_1 As String
Dim filefield As Long
filefield = FreeFile
paths = "d:\数据包" & "\" & Year(Text1.Text) & "_" & Month(Text1.Text) & "_" & Day(Text1.Text) & ".txt"
paths_1 = "d:\数据" & "\" & "data_sum" '
Open paths For Binary As #1
Open paths_1 For Binary As #filefield
Do While Not EOF(1)
Line Input #1, str
arr = Split(str, ",")
Put #filefield, , CSng(arr(1)) & " " & CSng(arr(2)) & " " & CSng(arr(3)) & " " & CSng(arr(4)) & " " & CSng(arr(5)) & " " & CSng(arr(6)) & " " & CSng(arr(7))
Loop
Close #1
Close #2
End Sub
运行后老提示文件已经打开! 展开
Private Sub Command1_Click()
Dim i As Double
i = 1
Dim k As Integer
Dim l As Integer
Dim ayy(7) As Single
Dim str As String
Dim paths As String
Dim paths_1 As String
Dim filefield As Long
filefield = FreeFile
paths = "d:\数据包" & "\" & Year(Text1.Text) & "_" & Month(Text1.Text) & "_" & Day(Text1.Text) & ".txt"
paths_1 = "d:\数据" & "\" & "data_sum" '
Open paths For Binary As #1
Open paths_1 For Binary As #filefield
Do While Not EOF(1)
Line Input #1, str
arr = Split(str, ",")
Put #filefield, , CSng(arr(1)) & " " & CSng(arr(2)) & " " & CSng(arr(3)) & " " & CSng(arr(4)) & " " & CSng(arr(5)) & " " & CSng(arr(6)) & " " & CSng(arr(7))
Loop
Close #1
Close #2
End Sub
运行后老提示文件已经打开! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询