麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

歡迎使用CSDN-markdown編輯器

2019-11-06 07:18:43
字體:
來源:轉載
供稿:網友
<form id="fm" method="post" enctype="mult模板編號: </td> <td> <select id="drpMobanbianhao" class="easyui-combobox" style="width: 150px;" required="true" panelheight="auto" runat="server"> </select> </td> <td class="tb_left"> 模板名稱: </td> <td> <input id="txtSTempName" class="easyui-textbox" required="true" /> </td> </tr> <tr> <%--<td class="tb_left"> 是否必填: </td> <td> <input type="radio" class="radio" name="RidCMandatory" style="width: 25px;" value="0" checked="checked" /><label style="display: inline-block; height: 17px;">否</label> <input type="radio" class="radio" name="RidCMandatory" style="width: 25px;" value="1" /><label style="display: inline-block; height: 17px;">是</label> </td>--%> <td class="tb_left"> 文件: </td> <td> <div id="isShow"> <a id="linFileUrl" href="#" onclick="DownLoad()">下載模板</a> </div> </td> <td class="tb_left"> 文件名稱: </td> <td> <input id="txtSFileName" class="easyui-textbox" required="true" /> </td> <td class="tb_left"> 文件類型: </td> <td> <input id="txtSFileType" class="easyui-textbox" required="true" /> </td> </tr> <tr> <td class="tb_left"> 上傳模板: </td> <td colspan="3"> <input id="txtUploadMB" name="txtSFileUnit" class="easyui-filebox" required="true" data-options="["Random"] %>&flag=VariType' } }"> 變量類型 </th> <th data-options="field:'SVariName',width:280,align:'left',editor:'textbox'"> 變量名 </th> <th data-options="field:'SVariCnName',width:280,align:'left',editor:'textbox'"> 中文名 </th> <th data-options="field:'SVariWdTableName',width:80"> 對應文檔表格名稱 </th> <th data-options="field:'SVariWdTableOrder',width:580,align:'left',editor:'textbox'" hidden="true"> 對應文檔表格下標 </th> <th data-options="field:'SVariCoName',width:100, formatter:function(value,row){ return row.tableNameComment; }, editor:{ type:'combobox', options:{ valueField:'SVariCoName', textField:'tableNameComment', method:'get', url: '/Handler/SysMod/Docunmen.ashx/ProcessRequest?random=<%=Session["Random"] %>&flag=QueryTableInfoList', onSelect: GetValue } }"> 源名稱 </th> <th data-options="field:'NVariCoType',width:100, formatter:function(value,row){ return row.NVariCoName; }, editor:{ type:'combobox', options:{ valueField:'NVariCoType', textField:'NVariCoName', method:'get', url: '/Handler/SysMod/Docunmen.ashx/ProcessRequest?random=<%=Session["Random"] %>&flag=MajorOrSub' } }"> 源類型 </th> <th data-options="field:'SVariColumn',width:100, formatter:function(value,row){ return row.SVariCoCommonets; }, editor:{ type:'combobox', options:{ valueField:'SVariColumn', textField:'SVariCoCommonets', method:'get' } }"> 字段名 </th> </tr> </thead> </table> </div> </div> <%--在這里將變量列表體現出來--%> </form>

<td class="tb_left"> 上傳模板: </td> <td colspan="3"> <input id="txtUploadMB" name="txtSFileUnit" class="easyui-filebox" required="true" data-options="prompt:'選擇文件...',buttonText:'選擇文件',onChange:function(){uploadFiles()}" style="width: 370px;" /> </td>//這里是前臺頁面使用easyui實現的功能,需要引用easyui文件 function uploadFiles() { $('#fm').form('submit', { url: '/Handler/SysMod/Docunmen.ashx/ProcessRequest?Ran=' + Math.random() + '&flag=UploadFile', success: function (result) { var result = eval('(' + result + ')'); //可以寫一些提示的代碼等等.. $("#dd").datagrid({ rownumbers: true, data: result, pageSize: 10, height: 500, onEndEdit: onEndEdit, singleSelect: true, //單選 method: 'get', striped: true, fit: true, onClickCell: onClickCell }); } }); }`` //在這里是實現的具體方法 //在一般處理性程序頁面中 public void ProcessRequest(HttpContext context) { if (context.Request[“flag”] == “UploadFile”) { UploadFile(context); } }

private void UploadFile(HttpContext context) { context.Response.ContentType = "text/plain"; int length = context.Request.Files.Count; HttpFileCollection files = context.Request.Files; if (files.Count > 0) { for (int i = 0; i < files.Count; i++) { HttpPostedFile file = files[i]; if (file.ContentLength > 0) { //全路徑 string FullFullName = file.FileName; FileName = FullFullName; //獲取名稱 string sPt = context.Request.applicationPath + FileName; file.SaveAs(sPt); String fileName = FullFullName.Substring(FullFullName.LastIndexOf("http://") + 1); string path = "UploadFile"; fileName = Guid.NewGuid().ToString() + fileName;//防重名 SaveFileName = fileName; Stream requestStream = null; Stream fileStream = null; FtpWebResponse uploadResponse = null;//創建FtpWebResponse實例uploadResponse try { //獲取文件長度 int FileLength = file.ContentLength; FtpWebRequest uploadRequest = createFtpWebRequest(fileName); uploadRequest.Method = WebRequestMethods.Ftp.UploadFile;//將FtpWebRequest屬性設置為上傳文件 requestStream = uploadRequest.GetRequestStream();//獲得用于上傳FTP的流 byte[] buffer = new byte[FileLength]; fileStream = file.InputStream;//截取FileUpload1獲取的文件流,作為上傳FTP的流 fileStream.Read(buffer, 0, FileLength); requestStream.Write(buffer, 0, FileLength);//將buffer寫入流 requestStream.Close(); uploadResponse = (FtpWebResponse)uploadRequest.GetResponse();//返回FTP服務器響應,上傳完成 //上傳成功 } catch (Exception ex) { string s = ex.Message.ToString(); context.Response.Write(s.Substring(0, s.Length - 4) + "/n請聯系管理員!"); context.Response.End(); return; } finally { if (uploadResponse != null) uploadResponse.Close(); if (fileStream != null) fileStream.Close(); if (requestStream != null) requestStream.Close(); } //if (!Directory.Exists(System.Web.HttpContext.Current.Server.MapPath(path))) //{ // Directory.CreateDirectory(System.Web.HttpContext.Current.Server.MapPath(path)); //} ////保存文件。 //file.SaveAs(System.Web.HttpContext.Current.Server.MapPath(path) + "http://" + fileName); //FileName = System.Web.HttpContext.Current.Server.MapPath(path) + "http://" + fileName; #region 讀取文檔中的內容 List<ModelPmVariable> variablList = new List<ModelPmVariable>(); #region 讀取單一值 //string str="$fdddd$"; //var docum = copyWordDoc(FileName); var docum = new aspose.Words.Document(sPt); string[] str = docum.Range.Text.Split(' '); string pattern = @"^/$.*/$$"; foreach (var item in str) { Regex regex = new Regex(pattern, RegexOptions.Singleline); if (regex.IsMatch(item.Replace("/r", "").Replace("/n", ""))) { ModelPmVariable mbv = new ModelPmVariable(); mbv.SVariName = regex.Match(item).Value; mbv.NVariType = "1"; mbv.NVariName = "單一值"; variablList.Add(mbv); } } variablList = variablList.Where((x, j) => variablList.FindIndex(z => z.SVariName == x.SVariName) == j).ToList(); #endregion #region 讀取表格變量 doc = new Document(sPt); string result = Read();//這里是讀取表格中的變量 if (!string.IsNullOrEmpty(result)) { string[] strtb = result.TrimEnd('&').Split('&'); foreach (var item in strtb) { ModelPmVariable mbv = new ModelPmVariable(); mbv.SVariWdTableOrder = Convert.ToInt32(item.Replace("/r", "").Replace("/n", "").Split(';')[0].Split('+')[0]); mbv.SVariWdTableName = item.Replace("/r", "").Replace("/n", "").Split(';')[0].Split('+')[1]; mbv.SVariName = item.Replace("/r", "").Replace("/n", "").Split(';')[1]; mbv.NVariType = "2"; mbv.NVariName = "表格"; variablList.Add(mbv); } } #endregion //System.IO.Directory.Delete(sPt);//將服務器文件刪除 var sbJson = com.json(variablList, variablList.Count); context.Response.Write(sbJson.ToString()); context.Response.End(); #endregion } } } }```在這里可以下載Aspose

http://download.csdn.net/detail/airforcetwo/9770778


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 激情亚洲一区二区 | 精品一区二区三区在线观看视频 | 中文字幕在线播放一区 | 成人免费在线播放 | a视频在线播放 | 美女在线观看视频一区二区 | 国产一区二区视频在线播放 | 男女做性免费网站 | 精品一区二区久久久久久久网精 | 亚洲精品久久久久久下一站 | 日本黄色不卡视频 | 色污视频在线观看 | 久久精品伊人网 | 午夜精品成人 | 成年性羞羞视频免费观看无限 | 欧美成人一区免费视频 | 免费一级a毛片在线播放视 日日草夜夜操 | 99亚洲伊人久久精品影院红桃 | 伊人午夜视频 | chinese hd xxxx tube| 成人三级电影网站 | 欧美视频一区二区三区四区 | 精品一区二区三区中文字幕老牛 | 精品一区二区在线视频 | 97视频| 一级做a爱片性色毛片高清 国产精品色在线网站 | 免费看日产一区二区三区 | 视频在线91| 国产精品一区二区视频 | 中文字幕一区在线观看视频 | 国产精品99久久久久久久 | 本站只有精品 | 色悠悠久久久久 | 天堂成人国产精品一区 | 欧美一级片免费在线观看 | 国产精品自拍啪啪 | 久久久久久久久成人 | 国产乱弄| 精品久久久久久久久中文字幕 | 性 毛片 | 黄色羞羞 |