03 2011 档案

摘要:警告1 方法“Microsoft.Office.Interop.Word._Document.Close(refobject,refobject,refobject)”和非方法“Microsoft.Office.Interop.Word.DocumentEvents2_Event.Close”之间存在二义性。将使用方法组。 部分程序: Word.Documentdoc=null; . . . if(doc!=null) { doc.Close(refmissing,refmissing,refmissing);//警告行 doc=null; }解决方案:Word._Documentdoc=nu 阅读全文
posted @ 2011-03-24 22:39 94cool 阅读(2782) 评论(2) 推荐(1)
摘要:1、菜单window->Preferences->Java->Editor->Content Assist->Enable auto activation 选项要打上勾 2、windows-->preference-->workbench-->keys 下设置Content Assist 的快捷键 3、window->Preferences->Java->Editor->Content Assist->Advanced 上面的选项卡Select the proposal kinds contained in the 阅读全文
posted @ 2011-03-24 11:07 94cool 阅读(294) 评论(0) 推荐(0)
摘要:public void Export(DataSet ds, string path) { try { StringBuilder sb = new StringBuilder(); foreach (DataGridViewColumn column in gvList.Columns) { sb.Append(column.HeaderText + "\t"); } sb.Append("\n"); foreach (DataGridViewRow row in gvList.Rows) { foreach (DataGridViewColumn c 阅读全文
posted @ 2011-03-14 08:12 94cool 阅读(210) 评论(0) 推荐(0)
摘要:1、在Form Load事件中加入System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;是最简单的方式!2、创建代理delegate void SetTextCallback(string text);创建和启动线程this.demoThread =new Thread(new ThreadStart(this.ThreadProcUnsafe)); this.demoThread.Start();线程中要求改主窗体UI中的text属性private void ThreadProcSafe() { this.S 阅读全文
posted @ 2011-03-13 20:25 94cool 阅读(325) 评论(0) 推荐(0)
摘要:public void Export(DataSet ds, string path) { try { string data = ""; foreach (DataTable tb in ds.Tables) { foreach (DataColumn column in tb.Columns) { data += column.ColumnName + "\t"; } data += "\n"; foreach (DataRow row in tb.Rows) { foreach (DataColumn column in tb. 阅读全文
posted @ 2011-03-11 09:22 94cool 阅读(424) 评论(0) 推荐(0)
摘要:View Code publicstaticvoidHttpUploadFile(stringurl,stringfile,stringparamName,stringcontentType,NameValueCollectionnvc){log.Debug(string.Format("Uploading{0}to{1}",file,url));stringboundary="---------------------------"+DateTime.Now.Ticks.ToString("x");byte[]boundarybyt 阅读全文
posted @ 2011-03-05 22:18 94cool 阅读(2186) 评论(2) 推荐(1)
摘要:用户认证HttpWebRequest可以实现的啊最简单的方法,就是把用户名和密码放入url中比如:http://username:password@www.abc.com/复杂的办法可以在请求的header里面添加Authorization。格式为:Basic + base64(username:password)如:public static string SendDataByGET(string Url, string postDataStr, ref CookieContainer cookie) { try { string url = Url + (postDataStr == &q 阅读全文
posted @ 2011-03-02 11:40 94cool 阅读(270) 评论(0) 推荐(0)