7,785
社区成员




Option Explicit
Private Sub loadfiletotext(ByVal s As String, t As TextBox)
Dim l As Long
l = FileLen(s)
ReDim a(0 To l - 1) As Byte
Open s For Binary As #1
Get #1, , a
Close #1
t.Text = StrConv(a, vbUnicode)
End Sub
Private Sub savetexttofile(t As TextBox, ByVal s As String)
Open s For Output As #1
Print #1, t.Text
Close #1
End Sub
Private Sub Command1_Click()
loadfiletotext "d:\temp001.txt", Text1
End Sub
Private Sub Command2_Click()
savetexttofile Text1, "d:\temp001.txt"
End Sub