111,115
社区成员




using( FileStream fs = new FileStream("d:\2.doc", FileMode.Create) )
{
using( FileStream f = new FileStream("d:\1.doc", FileMode.Open) )
{
byte[1024] byteData;
int length = f.Read(byteData, 0, byteData.Length);
while(length > 0)
{
fs.Write(byteData, 0, length);
length = f.Read(byteData, 0, byteData.Length);
}
}
}
Using fs As IO.FileStream = New IO.FileStream("d:\2.doc", IO.FileMode.Create)
Using f As IO.FileStream = New IO.FileStream("d:\1.doc", IO.FileMode.Open)
Dim byteData(1024) As Byte
Dim intLen As Integer = f.Read(byteData, 0, byteData.Length)
While intLen > 0
fs.Write(byteData, 0, intLen)
intLen = f.Read(byteData, 0, byteData.Length)
End While
End Using
End Using