<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    網站開發

    asp.net
    隨筆 - 30, 文章 - 0, 評論 - 9, 引用 - 0
    數據加載中……

    文件上傳

    ?function OutputUpload(id,title) { var tblMain=document.getElementById("Table2"); var tbl=document.getElementById("Table3"); var isExsitfile=document.getElementById("file"+id); var text=document.createTextNode("上傳:"+title+"虛擬形象圖片"); if(isExsitfile==null) { var str= ""; tbl.rows[id].cells[0].insertAdjacentHTML("beforeEnd",str) ; tbl.rows[id].cells[0].appendChild(text); } else { tbl.rows[id].cells[0].removeChild(isExsitfile); tbl.rows[id].cells[0].innerText=""; } }

    if(Request.Form["CHK"]!=null)
    ???{?? string chkvalue=Request.Form["CHK"].ToString();
    ????string[] mylayer=chkvalue.Split(new char[]{','});
    ????string layer="";
    ????for(int i=0;i<mylayer.Length;i++)
    ????{?????
    ?????
    ?????if(layer!="")
    ?????{
    ??????layer+="_";
    ?????}
    ?????layer+=mylayer[i];
    ?????
    ????}
    ????ViewState["layer"]=layer;
    ??????
    ????//得到數據庫編號
    ????if(itemid1.ToString()==null)
    ????{
    ?????itemid1=itemid1+1;
    ????}
    ????else
    ????{
    ?????itemid1=GetItemID()+1;
    ????}
    ????System.Web.HttpFileCollection files=System.Web.HttpContext.Current.Request.Files;
    ????try
    ????{
    ?????for(int i=0;i<files.Count;i++)
    ?????{??
    ??????string fid=itemid1+".gif";
    ??????HttpPostedFile postedFile=files[i];
    ??????
    ??????if(postedFile.FileName.Length>0)
    ??????{
    ???????string fileName,fileExtension;
    ???????fileName=System.IO.Path.GetFileName(postedFile.FileName);
    ???????fileExtension=System.IO.Path.GetExtension(fileName);

    ???????if(fileExtension!=GlobalVars.FILETAILNAME[0])
    ???????{
    ????????Response.Write("<script>alert(\"文件格式不正確!!!\")</script>");
    ????????return;
    ???????}
    ???????if(i==0)
    ???????{
    ????????//上傳圖片到服務器上??
    ????????BLL.Visual_Items bll=new BLL.Visual_Items();
    ????????bool tf=bll.Exists(this.txtName.Text);
    ????????if(tf==false)
    ????????{??
    ?????????if(System.IO.Directory.Exists(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\0"))
    ?????????{
    ??????????postedFile.SaveAs(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\0\\" + fid);?
    ?????????}
    ?????????else
    ?????????{
    ??????????System.IO.Directory.CreateDirectory(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\0");
    ??????????postedFile.SaveAs(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\0\\" + fid);?
    ?????????}
    ?????????// 把圖片的信息記錄保留到數據庫中
    ?????????string s="images/img_Visual/show/0/"+fid;
    ?????????AddData(s,itemid1,layer);

    ????????}
    ????????else
    ????????{
    ?????????this.Response.Write("<script>alert('數據庫已存在此條數據!')</script>");
    ????????}

    ???????}
    ???????else
    ???????{
    ????????if(System.IO.Directory.Exists(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\"+mylayer[i-1]))
    ????????{
    ?????????postedFile.SaveAs(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\"+mylayer[i-1]+"\\" + fid);
    ????????}
    ????????else
    ????????{
    ?????????System.IO.Directory.CreateDirectory(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\"+mylayer[i-1]);
    ?????????postedFile.SaveAs(Server.MapPath(Request.ApplicationPath) + "\\images\\img_Visual\\show\\"+mylayer[i-1]+"\\" + fid);

    ????????}
    ???????}
    ??????}
    ??????else
    ??????{
    ???????Response.Write("<script>alert(\"虛擬形象圖片不能為空!\")</script>");
    ???????return ;

    ??????}
    ?????}?
    ????}
    ????catch(Exception ex)
    ????{
    ?????string sRawURL = Request.RawUrl;

    ?????if(sRawURL.IndexOf("?") > -1)
    ?????{
    ??????sRawURL = sRawURL.Substring(0,sRawURL.IndexOf("?"));
    ?????}????
    ?????
    ?????Response.Write(ex.ToString());
    ????}?
    ???}
    ???else
    ???{
    ?????????????? Response.Write("<script>alert(\"請選擇虛擬形象所屬層!!\")</script>");
    ???}

    posted on 2006-12-16 11:31 風雨兼程 閱讀(242) 評論(0)  編輯  收藏 所屬分類: Asp.net

    主站蜘蛛池模板: 国产成人精品免费久久久久| 国产精品亚洲精品爽爽| a级毛片免费完整视频| 亚洲人成网亚洲欧洲无码| 猫咪免费人成网站在线观看| 曰皮全部过程视频免费国产30分钟 | 亚洲欧美黑人猛交群| 曰批全过程免费视频在线观看| mm1313亚洲精品无码又大又粗| 亚洲AV无码不卡在线播放| 亚洲色成人网站WWW永久四虎| 成人免费毛片内射美女APP| 国产精品亚洲综合五月天| 毛片免费在线观看网址| 国产精品亚洲AV三区| 亚洲国产精品成人一区| 亚洲人色大成年网站在线观看| 成年黄网站色大免费全看| 亚洲一区二区三区在线网站| 女人被男人桶得好爽免费视频 | 精品在线观看免费| 亚洲人成影院在线观看| 亚洲最大中文字幕无码网站| 免费看香港一级毛片| 一级毛片完整版免费播放一区| 美女视频黄是免费的网址| 国产亚洲大尺度无码无码专线| 免费无码又爽又刺激网站| 亚洲国产精品自在线一区二区 | 三根一起会坏掉的好痛免费三级全黄的视频在线观看| 免费很黄很色裸乳在线观看| 中文字幕乱码免费看电影| 亚洲理论片中文字幕电影| 97国免费在线视频| 亚洲明星合成图综合区在线| 精品久久洲久久久久护士免费| 久久久久久噜噜精品免费直播| 亚洲精品国产成人中文| 国产又黄又爽又刺激的免费网址 | 亚洲精品无码久久久| 另类小说亚洲色图|