上传文件方案集锦 大家给提供个上传文件的方案,上传速度越快越好!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 OpenFileDialog myOpenFileDialog = new OpenFileDialog(); myOpenFileDialog.FileName = ""; myOpenFileDialog.Filter = "All Files(*.*)|*.*"; DialogResult result = myOpenFileDialog.ShowDialog(); if (result == DialogResult.OK) { FileInfo fileInfo = new FileInfo(myOpenFileDialog.FileName); string directory = fileInfo.DirectoryName; int start = directory.Length; if (string.IsNullOrEmpty(fileInfo.Extension)) { MessageBox.Show("出错"); return; } FileName = myOpenFileDialog.FileName.Substring(start); string FileType = fileInfo.Extension.Substring(1); int FileSize = Convert.ToInt32(fileInfo.Length); this.textBox1.Text = FileName; int size = (int)fileInfo.Length; byte[] file = new byte[size]; System.IO.FileStream fs = new System.IO.FileStream(myOpenFileDialog.FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); System.IO.BinaryReader br = new System.IO.BinaryReader(fs); file = br.ReadBytes(size); file1 = (byte[])(file.Clone()); file = null; fs.Close(); } ftp方式codeproject上有例子 ftp传输是不是和socket传输速度差不多 点对点 传输除了socket还有什么方法? 那像Socket如何根据网速来传数据呢?我现在每次都是固定传输,比如说是1024个字节 请问如何取消monthcalendar的翻月事件呢? datagrid绑定dataset后怎样设置列宽 请教一SQL语句 Microsoft Visual Studio DynamicField用法 求救:RegularExpressionValidator正则表达式,输入不能是"默认"! 急,急,急,在线等 关于文本文档读取的问题 真心求教 [问题点数:100分] 100分求利用API函数BeginPath等方法画一个由两点直线和圆弧组成的多边形 C#程序无法在win2000下运行的问题 如何在cs文件的线程中使用Session C# From_Load和Button_Click 问题??
myOpenFileDialog.FileName = "";
myOpenFileDialog.Filter = "All Files(*.*)|*.*";
DialogResult result = myOpenFileDialog.ShowDialog(); if (result == DialogResult.OK) {
FileInfo fileInfo = new FileInfo(myOpenFileDialog.FileName);
string directory = fileInfo.DirectoryName;
int start = directory.Length; if (string.IsNullOrEmpty(fileInfo.Extension)) {
MessageBox.Show("出错");
return;
}
FileName = myOpenFileDialog.FileName.Substring(start);
string FileType = fileInfo.Extension.Substring(1);
int FileSize = Convert.ToInt32(fileInfo.Length); this.textBox1.Text = FileName;
int size = (int)fileInfo.Length;
byte[] file = new byte[size];
System.IO.FileStream fs = new System.IO.FileStream(myOpenFileDialog.FileName, System.IO.FileMode.Open,
System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
file = br.ReadBytes(size);
file1 = (byte[])(file.Clone());
file = null;
fs.Close();
}
codeproject上有例子
除了socket还有什么方法?
我现在每次都是固定传输,比如说是1024个字节