摘要: protected void btnSubmit_Click(object sender, EventArgs e) { string strReqXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns 阅读全文
posted @ 2012-05-15 08:45 魔都_XL 阅读(127) 评论(0) 推荐(0) 编辑
摘要: protected void btnExport_Click(object sender, EventArgs e) { Baosight.EMS.RealManage.BusinessLogic.DefaultImpl.MediumManager aa = new Baosight.EMS.RealManage.BusinessLogic.DefaultImpl.MediumManager(); EnergyT energyName = aa.GetEnergyById(strEnergy); ToExcelFile(this.Page, "实... 阅读全文
posted @ 2012-02-14 14:59 魔都_XL 阅读(817) 评论(2) 推荐(0) 编辑
摘要: 在 C# 中,(int),Int32.Parse() 和 Convert.toInt32() 三种方法有何区别? int 关键字表示一种整型,是32位的,它的 .NET Framework 类型为 System.Int32。 (int)表示使用显式强制转换,是一种类型转换。当我们从 int 类型到 long、float、double 或decimal 类型,可以使用隐式转换,但是当我们从 long 类型到 int 类型转换就需要使用显式强制转换,否则会产生编译错误。 Int32.Parse()表示将数字的字符串转换为32 位有符号整数,属于内容转换[1]。 我们一种常见的方法:public s 阅读全文
posted @ 2012-01-29 10:23 魔都_XL 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 1 private void insertIntoMes(string dayTime, string strNYCode, string strNYName, string strActWT, string strComName, string strNote) 2 { 3 string connectionString = ConfigurationManager.ConnectionStrings["AppDBServer"].ConnectionString; 4 OracleConnection con = new OracleConnect... 阅读全文
posted @ 2011-11-23 14:45 魔都_XL 阅读(408) 评论(0) 推荐(0) 编辑
摘要: 新建个config文件<?xml version="1.0" encoding="utf-8"?><!-- 注意: 除了手动编辑此文件以外,您还可以使用 Web 管理工具来 配置应用程序的设置。 可以使用 Visual Studio 中的“网站”->“Asp.Net 配置”选项。 设置和注释的完整列表在 machine.config.comments 中, 该文件通常位于 \Windows\Microsoft.Net\Framework\v2.x\Config 中--><configuration> <ap 阅读全文
posted @ 2011-11-23 14:38 魔都_XL 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1 private void OpenExcel(string strExcelName,string strTempletPath, string dayTime) 2 { 3 ExcelApplication exc = new ExcelApplication(); 4 exc.DisplayAlerts = false; 5 exc.EnableEvents = false; 6 DirectoryInfo dir = new DirectoryInfo(ReportPathDispatch); 7 ... 阅读全文
posted @ 2011-11-23 11:02 魔都_XL 阅读(240) 评论(0) 推荐(0) 编辑
摘要: DirectoryInfo dir = new DirectoryInfo(ReportPathDispatch);foreach (FileInfo fi in dir.GetFiles("*.xls")){ if (fi.Name == strExcelName) { // 这个 fi 就是你要的 xls 文件 }}ReportPathDispatch是文件的物理路径例如:D:\ems\EMSReport\Report\调度报表,这个文件夹下面的内容; 阅读全文
posted @ 2011-11-23 10:53 魔都_XL 阅读(718) 评论(0) 推荐(0) 编辑
摘要: string strUrl = "mgDeviceDataAdd.aspx?"; string strStatus = "status:no;resizable:yes;toolbar=no;menubar=no;location=no;scroll:no;dialogWidth:700px;dialogHeight:500px;"; string startupScript = "<script language='javascript' type='text/javascript'>window. 阅读全文
posted @ 2011-09-22 14:09 魔都_XL 阅读(112) 评论(0) 推荐(0) 编辑
摘要: private void DoExcel() { Microsoft.Office.Interop.Excel.Application application = new Microsoft.Office.Interop.Excel.Application(); //这里释放所有引用的资源 application.Quit(); KillExcel(application); }[DllImport("User32.dll", CharSet = CharSet.Auto)] public static extern int ... 阅读全文
posted @ 2011-09-22 14:09 魔都_XL 阅读(178) 评论(0) 推荐(0) 编辑
摘要: (1) 第一种方法:int[] ia = {1,2,3};int id = Array.IndexOf(ia,1); // 这里的1就是你要查找的值if(id==-1) // 不存在else // 存在(2) 第二种方法:string[] strArr = {"a","b","c","d","e"};bool exists = ((IList)strArr).Contains("a");if(exists) // 存在else // 不存在注意: 用IList需要using 阅读全文
posted @ 2011-09-22 14:08 魔都_XL 阅读(1513) 评论(0) 推荐(1) 编辑