请教,关于图片上传的问题? http://expert.csdn.net/Expert/FAQ/FAQ_Index.asp?id=6404 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.jzeb.net/bbs/dispbbs.asp?boardID=1&ID=18 if(txtFile.PostedFile!=null & txtFile.PostedFile.ContentLength!=0){SqlConnection con=Connection.Con();string strFname=System.IO.Path.GetFileName(txtFile.PostedFile.FileName);string strFtype=txtFile.PostedFile.ContentType;int intFsize=txtFile.PostedFile.ContentLength;System.IO.Stream fileStream=txtFile.PostedFile.InputStream; Byte[] b=new Byte[fileStream.Length];fileStream.Read(b,0,b.Length);fileStream.Close();con.Open();SqlCommand cmd=new SqlCommand(@"Insert into [file](name,content,ftype,fsize) values( @Name,@Content,@ftype,@fsize)",con); SqlParameter pFileName=new SqlParameter("@Name",SqlDbType.NVarChar,strFname.Length,ParameterDirection.Input,false,0,0,null,DataRowVersion.Current,strFname);SqlParameter pFileData=new SqlParameter("@Content",SqlDbType.Image,b.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,b);SqlParameter pFileType=new SqlParameter("@ftype",SqlDbType.NVarChar,strFtype.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,strFtype);SqlParameter pFileSize=new SqlParameter("@fsize",SqlDbType.Int,strFtype.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,intFsize); cmd.Parameters.Add(pFileName);cmd.Parameters.Add(pFileData);cmd.Parameters.Add(pFileType);cmd.Parameters.Add(pFileSize);cmd.ExecuteNonQuery();con.Close();}else {return;} 有谁知道JQuery插件中的 trigger 的用法 ? 咨询点关于手机上网的问题 提问一个关于Viewstate的问题,很奇怪! 下垃列表联动出错! 用like搜索时,中文也有保留关键词或字吗? 每个页的CS文件都编译进DLL,那要想访问公共函数怎么办?我是新手请指点 什么是.TEXT Forum 求救!!!关于验证控件使用!!! 急!为何插入ACCESS数据库数据错误? 急求大神啊 帮我看一下这段代码 writefile的问题,急! 关于服务器com组件与客户端浏览器组件通信的问题
{
SqlConnection con=Connection.Con();
string strFname=System.IO.Path.GetFileName(txtFile.PostedFile.FileName);string strFtype=txtFile.PostedFile.ContentType;
int intFsize=txtFile.PostedFile.ContentLength;System.IO.Stream fileStream=txtFile.PostedFile.InputStream;
Byte[] b=new Byte[fileStream.Length];
fileStream.Read(b,0,b.Length);
fileStream.Close();con.Open();SqlCommand cmd=new SqlCommand(@"Insert into [file](name,content,ftype,fsize) values( @Name,@Content,@ftype,@fsize)",con);
SqlParameter pFileName=new SqlParameter("@Name",SqlDbType.NVarChar,strFname.Length,ParameterDirection.Input,false,0,0,null,DataRowVersion.Current,strFname);
SqlParameter pFileData=new SqlParameter("@Content",SqlDbType.Image,b.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,b);
SqlParameter pFileType=new SqlParameter("@ftype",SqlDbType.NVarChar,strFtype.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,strFtype);
SqlParameter pFileSize=new SqlParameter("@fsize",SqlDbType.Int,strFtype.Length, ParameterDirection.Input, false,0,0, null, DataRowVersion.Current,intFsize);
cmd.Parameters.Add(pFileName);
cmd.Parameters.Add(pFileData);
cmd.Parameters.Add(pFileType);
cmd.Parameters.Add(pFileSize);cmd.ExecuteNonQuery();con.Close();
}
else
{
return;
}