在頁面部分加入 input id=”uplthefile” type=”file” name=”uplthefile” runat=”server” 在代碼部分加: void btnU" name="description" />

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • Uploadfile

    發表于:2007-05-25來源:作者:點擊數: 標簽:mso-ascii-foUploadfileSimSun
    MI LY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN-CA">在頁面部分加入 input id=”uplthefile” type=”file” name=”uplthefile” runat=”server” 在代碼部分加: void btnU

    MILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN-CA">在頁面部分加入

    <input id=”uplthefile” type=”file” name=”uplthefile” runat=”server”>

    在代碼部分加:


    void btnUploadTheFile_Click(object sender, System.EventArgs e)

    {

      if (uplTheFile.PostedFile != null)

     {

        HttpPostedFile mFile= uplTheFile.PostedFile;

       int fileSize = mFile.ContentLength;

    if (fileSize==0)

    {

     txtErrMsg.InnerText = "No file uploaded, try again";

    return;

    }

    try

    {

    byte[] mFileByte = new Byte[fileSize];

    mFile.InputStream.Read(mFileByte,0,fileSize);

    string sFilename = ClientID + System.IO.Path.GetFileName(mFile.FileName);

    System.IO.FileStream saveFile = new System.IO.FileStream(Server.MapPath("~/"+Request.QueryString["UploadPath"]+ "/" + sFilename), System.IO.FileMode.Create);

    saveFile.Write(mFileByte,0, mFileByte.Length);

    saveFile.Close();

    }

    catch

    {

    txtErrMsg.InnerText = "File uploaded Unsuclearcase/" target="_blank" >ccessfull, try again";

    }

                    }

                                    }

    原文轉自:http://www.kjueaiud.com

    評論列表(網友評論僅供網友表達個人看法,并不表明本站同意其觀點或證實其描述)
    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>