C#
liaomin416100569
这个作者很懒,什么都没留下…
展开
-
如何删除某个控件的事件
FieldInfo keyfi = typeof(Control).GetField("EventClick", BindingFlags.Static | BindingFlags.NonPublic); object eventkey = keyfi.GetValue(button1); // Get the protect原创 2010-02-02 15:24:00 · 1302 阅读 · 0 评论 -
C#创建activex供js调用
建立vsstudio 工程点击 新建 -》项目-》window控件库 【名称自己随便取 比如:UserControl1.cs】首先 建立window 安全接口【为了防止ie浏览器阻止activex】同事在 -》properties 中的文件AssemblyInfo.cs 文件中添加一行[assembly: AllowPartiallyTrustedCallers()] //引入using System.Runtime.InteropServices;接口名称 IObjectSafety [Com原创 2010-06-15 12:53:00 · 2419 阅读 · 1 评论 -
c#创建快捷方式代码
<br />条件:<br /><br />COM下Windows Script Host Object Model,然后可以通过以下方法创建快捷方式。<br /> <br />方法:<br /> <br />bool CrtShortCut(string FilePath, string fileName)<br /> {<br /> //MessageBox.Show(Environment.GetFolderPath(Environment.SpecialFolder原创 2010-06-20 17:45:00 · 1161 阅读 · 0 评论 -
C# bho操作dom 同时带有隐藏工具栏功能,菜单栏
定义接口 IObjectWithSite 名称必须为:IObjectWithSite内容如下:using System;using System.Collections.Generic;using System.Text;using mshtml;using SHDocVw;using System.Runtime.InteropServices;namespace bho{ [ ComVisible(true), InterfaceType(ComInterfaceType.Interf原创 2010-12-17 16:26:00 · 2420 阅读 · 1 评论 -
c#允许多线程访问主线程创建的控件的代码
<br />只在在form中的构造方法中加入 <br /> <br />CheckForIllegalCrossThreadCalls = false;<br /> <br />这句代码就够了<br /> <br />当然也可是使用invoke (网上一大把文章)原创 2011-06-02 11:19:00 · 982 阅读 · 0 评论 -
如何获取excel对应的sheet个数和对应的名字
public static int GetExcelTableCount(string filename) { DataTable dt = new DataTable(); OleDbConnection cnnxls = new OleDbConnection(); try { string mystring = "Provider = Micro原创 2011-06-02 10:56:00 · 4340 阅读 · 0 评论