模块是一个商务在线聊天,不过就是在私聊的时候 ,可以有单独的对话框出来 ,最主要的是实现可以相互传送文件 ps:不是上传服务器。当然顺便实现一下视频功能就更完美了,web b/s结构的哦~谢谢高手指点 也希望有同样问题的朋友一起讨论!
解决方案 »
- 谁有关于服务器控件对应的客户端控件的属性及事件的详尽帮助手册?
- java里的super 相当c#里的什么关键字
- ajax control toolkit里的CascadingDropDown 控件能不能控制它只响应用户对dropdownlist的操作
- 请问我下载的asp.net程序看不到.cs文件。用什么工具可以看呢?
- asp.net 中的cookies 该如何使用
- 求论坛的建模模型图。求~~~
- VS2005的参考线如何创建呀
- 出售域名:有意这请发邮件:[email protected] ,Up这有分
- XML+ASP.NET菜问题,请各位抽空帮帮小弟
- 请诸位帮忙解决一个问题
- 求一从一段网页代码里面取得图片名字的正则表达式,在线等
- 如何连接带有密码的access数据库?
在webconfig中添加
<httpRuntime maxRequestLength = "40000"/>,具体多少合适我没有测试),还有就是大文件上传有点问题。
private Int32 UploadFile(HttpPostedFile postedFile,string strStoragePath) //new name path
{
int BuffSize = 1024*4;
Int32 i = postedFile.ContentLength;
string FilePath = postedFile.FileName;
if(FilePath == "" || FilePath == null)
Response.End();
string FileName = FilePath.Substring(FilePath.LastIndexOf("\\")+1);
try
{
Stream fClientStream;
FileStream fWStream;
fClientStream = (Stream)postedFile.InputStream;
if(File.Exists(strStoragePath)==false)
fWStream = new FileStream(strStoragePath,FileMode.Create);//不可覆盖
else return 0;//"Exist";
int iBlock =0;
for(;iBlock<postedFile.ContentLength/BuffSize;iBlock++)
{
byte[] bBuff = new byte[BuffSize];
fClientStream.Read(bBuff,0, BuffSize);
MemoryStream memStream = new MemoryStream(bBuff);
memStream.WriteTo(fWStream);
memStream.Close();
}
byte[] bSubBuff = new byte[postedFile.ContentLength%BuffSize];
fClientStream.Read(bSubBuff,0, postedFile.ContentLength%BuffSize);
MemoryStream SubStream = new MemoryStream(bSubBuff);
SubStream.WriteTo(fWStream);
SubStream.Close();
fWStream.Close();
fWStream = null;
fClientStream.Close();
}
catch(Exception ex)
{
return 0;
}
return i;
}