模块是一个商务在线聊天,不过就是在私聊的时候 ,可以有单独的对话框出来 ,最主要的是实现可以相互传送文件 ps:不是上传服务器。当然顺便实现一下视频功能就更完美了,web b/s结构的哦~谢谢高手指点 也希望有同样问题的朋友一起讨论!

解决方案 »

  1.   

    在网上看到的一些代码供大家参考,我还没实现,一起分析一下吧~
    在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;
    }
      

  2.   

    B/S结构的话,你去参考camefire,只能做到先上传到服务器再下载。
      

  3.   

    那就是b-s-b 模式了?camefire是什么啊?我msdn了一下,百度了一下,google了一下,看不出来是什么技术啊, 几乎都没有介绍的,不了解哦 麻烦再提示一下~谢谢顶上去!