protected void Bt_Process_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_Pass.Text)) { Response.Write("密码不能为空<br/>"); return; } if (string.IsNullOrEmpty(txt_IdList.Text)) { Response.Write("文件ID 不能为空<br/>"); return; } string[] keylist = txt_IdList.Text.Replace(Environment.NewLine, "$").Split('$'); foreach (var item in keylist) { Response.Write("开始解析<br/>"); BindBoxTool tool = new BindBoxTool(); ReturnValue _result = tool.ProcessUpInfoData(int.Parse(item), txt_Pass.Text); Response.Write(_result.Success.ToString() + "<br/>"); Response.Write(_result.ErrMessage + "<br/>"); Response.Write(string.Join("-", _result.MessageList.ToArray <string>() + "<br/>")); } }
/// <summary> /// 解析文件 /// </summary> /// <param name="filename"></param> /// <returns></returns> public ReturnValue RealseDataFile(string filename) { ReturnValue _result = new ReturnValue(); BindBoxTool bindBoxTool = new BindBoxTool(); List <RequestBindData> listitem = new List <RequestBindData>(); #region 检查文件并读取 if (File.Exists(filename) == false) { _result.Success = false; _result.ErrMessage = "没找到文件 " + filename; return(_result); } listitem = bindBoxTool.ReadBoxDataFileByXls(filename); if (listitem.Count == 0) { _result.Success = false; _result.ErrMessage = "没找到文件 " + filename; return(_result); } #endregion _result.ObjectValue = listitem; return(_result); }
protected void bt_ProcessIssueFile_Click(object sender, EventArgs e) { Response.Write("开始重新<br/>"); if (string.IsNullOrEmpty(txt_Filename.Text)) { Response.Write("路径不能为空<br/>"); return; } BindBoxTool tool = new BindBoxTool(); var _result = tool.ReProcessBindBox(txt_Filename.Text, txt_Boxnumber.Text); Response.Write(_result.Success.ToString() + "<br/>"); Response.Write(_result.ErrMessage + "<br/>"); Response.Write(string.Join("-", _result.MessageList.ToArray <string>() + "<br/>")); }
protected void Button1_Click(object sender, EventArgs e) { ; watch = new System.Diagnostics.Stopwatch(); watch.Start(); Response.Write(watch.Elapsed.TotalMilliseconds); Response.Write("开始压缩<br/>"); ExportFileByZip(18); watch.Stop(); Response.Write(watch.Elapsed.TotalMilliseconds); return; //YHFramework.DAL.CodeDataDal codedatadal = new CodeDataDal(); //OutFileFactory FileFactory = new OutFileFactory(); //IOutFile outfile = FileFactory.CreateNewObj(OutFileType.XLSX2); //string tempfilename = "test" + outfile.ExtName; //string tempfilepath = System.AppDomain.CurrentDomain.BaseDirectory + "tempfile\\"; //DataTable dt2 = codedatadal.GetPageList(" a.* ", "", "", 1, 100); //outfile.OutFilePath = tempfilepath; //outfile.FileName = tempfilename; //if (File.Exists(tempfilepath + tempfilename)) //{ // File.Delete(tempfilepath + tempfilename); //} //outfile.OutFile(dt2); //return; //DataTable dt = TableDAL.GetTable("ApployInfo", "id=" + 40); //if (null != dt && 0 < dt.Rows.Count) //{ // dt.Rows[0]["Status"] = 2; // dt.Rows[0]["UpdateTime"] = System.DateTime.Now; // #region --发送邮件 // string mailBody = ""; // mailBody += "农夫-河源工厂串码传输平台项目(批号:" + dt.Rows[0]["BathCode"].ToString() + ")下载的解压密码为:" + dt.Rows[0]["Secret"].ToString() + System.Environment.NewLine + System.Environment.NewLine; // mailBody += "本邮件中所包含的信息可能是保密并受相关法律保护的。本邮件仅供收件人参阅。我们特此告知,如果您不是特定的收件人,您对本邮件任何的使用、转发、传播或复制是被严令禁止的并且可能是违法的,请通过发还电子邮件的方式联系发件人,并且销毁所有的原始邮件。" + System.Environment.NewLine; // //string titles = "建项申请,【待审批】项目名称:" + m.Name + ",项目编号:" + m.ProjectNo; modify by lanyiwei 20161109 title 显示不下全部内容,进行精简 // string titles = "【农夫-河源工厂串码传输平台】解压密码"; // Common.EmailTool.sendEmail("*****@*****.**", titles, mailBody, ""); // #endregion //} //Response.Write("测试结束<br/>"); //return; Response.Write("开始解析<br/>"); BindBoxTool tool = new BindBoxTool(); //ReturnValue _result = tool.ProcessUpInfoData(52, "*****@*****.**"); //Response.Write(_result.Success.ToString() + "<br/>"); //Response.Write(_result.ErrMessage + "<br/>"); //watch= new System.Diagnostics.Stopwatch(); //watch.Start(); // Response.Write(watch.Elapsed.TotalMilliseconds); //Response.Write("开始压缩<br/>"); // ExportFileByZip(1); // ExportFileByZip(2); //watch.Stop(); // Response.Write(watch.Elapsed.TotalMilliseconds); }