上传文件到共享文档

string newFilePath = @"//10.124.1.1/send/" + fileName;
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);
FileStream fsInput = new FileStream(newFilePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite);
BinaryReader br = new BinaryReader(fs, Encoding.Unicode);
BinaryWriter sw = new BinaryWriter(fsInput, Encoding.Unicode);
Byte[] postArray = br.ReadBytes(int.Parse(fs.Length.ToString()));
sw.Write(postArray);
fsInput.Close();
fs.Close();

posted @ 2016-09-28 15:15  开开123  阅读(164)  评论(0编辑  收藏  举报