/// <summary>
        /// 保存文件流
        /// </summary>
        /// <param name="path"></param>
        /// <param name="encode"></param>
        public void SaveAs(string path, Encoding encode)
        {
            if (!Path.IsPathRooted(path))
            {
                return;
            }

            FileStream s = new FileStream(path, FileMode.OpenOrCreate);

            try
            {
                _stream.Seek(0, SeekOrigin.Begin);
                ComFunc.CopyStream(_stream, s, _encoding, encode);
                s.Flush();
            }
            finally
            {
                s.Dispose();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 保存文件流
        /// </summary>
        /// <param name="path"></param>
        public override void SaveAs(string path)
        {
            if (!Path.IsPathRooted(path))
            {
                return;
            }
            FileStream s = new FileStream(path, FileMode.OpenOrCreate);

            try
            {
                _stream.Seek(0, SeekOrigin.Begin);
                ComFunc.CopyStream(_stream, s);
                //this._stream.CopyTo(s);
                s.Flush();
            }
            finally
            {
                s.Close();
            }
        }
 public FrameUploadFile(string filename, string contentype, Stream file)
 {
     this._filename    = filename;
     this._contentType = contentype;
     ComFunc.CopyStream(file, this._stream);
 }
Esempio n. 4
0
 public FrameUploadFile(HttpPostedFile file)
 {
     this._filename    = file.FileName;
     this._contentType = file.ContentType;
     ComFunc.CopyStream(file.InputStream, this._stream);
 }