string strFileName;
strFileName=this.upPIC.PostedFile.FileName;
FileStream fs = new FileStream(strFileName, FileMode.OpenOrCreate, FileAccess.Read);以上代码在本机上运行正常,但是传到服务器中运行却提示:
Could not find a part of the path "C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif". 可能是由于上面的代码只读取服务器上的C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif文件而非读取客户端上的文件!如何解决!?
strFileName=this.upPIC.PostedFile.FileName;
FileStream fs = new FileStream(strFileName, FileMode.OpenOrCreate, FileAccess.Read);以上代码在本机上运行正常,但是传到服务器中运行却提示:
Could not find a part of the path "C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif". 可能是由于上面的代码只读取服务器上的C:\Documents and Settings\Administrator\My Documents\My Pictures\1.gif文件而非读取客户端上的文件!如何解决!?
解决方案 »
- 新手提问:如果改变DetailsView编辑、插入状态下编辑框的宽度
- 大师们,在Repeater调用button 方法这样写对不对OnClick="TestBtn( <%#Eval("A_ID")%>,<%#Eval("A_Que
- 索引是指什么?各位大侠赐教!
- (简单)Gridview 模板列 怎么添加事件
- 第一次写了一个非常简单的asp,自己两天都没有解决,书中也没有找到答案,在线等您的指教
- 在一个DataSet对象中,可不可以筛选?
- SQL Server2000如何使用?
- Asp.net 页面导航的几种方法与比较
- 为什么会错?
- 100分,来者有分,大家都用asp.net 做什么?
- asp.net C#如何将几个Excel文件合成一个Excel文件
- 调试ASP.NET程序时,全部出现空白页,无论什么控件也显示不出来,什么原因啊?
HttpPostedFile pf=fu.PostedFile;
if(pf==null||pf.ContentLength==0)
Response.Write("ûÓÐÎļþ±»ÉÏ´«£¡");
else{
int fl=pf.ContentLength;
MemoryStream ms=new MemoryStream();
byte[] fb=new byte[fl];
Stream fs=pf.InputStream;
fs.Read(fb,0,fl);
string s=Encoding.GetEncoding("gb2312").GetString(fb);
lb_file.Text=s;
}
}