随笔分类 - 05WinForm
Window form design
摘要:今天从CSDN上看到一篇关于待机状态下使用程序唤醒电脑的代码,感觉很好,不过没有试过,现把代码转过来以供日后有用的时候再试一下。using System;using System.Runtime.InteropServices;using Microsoft.Win32.SafeHandles;using System.Threading;using System.ComponentModel;namespace ConsoleApplication1 { class Program { [DllImport("kernel32.dll")] public static extern Safe
阅读全文
摘要:今天在CSDN看到有为星星大哥问了个关于耗时处理的问题,其实这个问题应该使我们在项目中经常会碰到的。当时我尝试了一下,现在吧自己的实现方法写下来,供有需要的同志参考:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace AsynCallMethod{ public partial
阅读全文
摘要:源代码在我的资源空间里,有兴趣的可以去看一下。源代码
阅读全文
摘要:源代码下载地址你想过为自己的程序添加靠边隐藏的功能吗?还在为计算窗体的大小及位置而烦恼吗?想这么简单的轻松调用吗?DockWindow.FormDockTemplate m_oDockFormTemplate = new DockWindow.FormDockTemplate(this);不用吃惊,您只需要在你的窗体初始化的时候(也就是窗体构造函数里添加上述这一行代码)您的程序就可以轻松拥有靠边自动隐藏的功能。下面我就给各位共享一个我自己经常用的靠边停靠的窗体类,详细见如下代码:FormDockTemplate.cs文件:using System; using System.Collectio
阅读全文
摘要:源代码下载Excel操作的过程放在一个类里,类代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.OleDb;namespace Excel2DatagridViewTest{ public class HandleExcel { private static string strExcelConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Sourc
阅读全文
摘要:源代码下载地址最近做的一个项目需要取得系统托盘的信息,在网上找了一些资料,不过大部分都是C++类的,没有一些完整的实现,所以自己按照那些说的思路在C#里进行摸索,最后总处是达到了目的,以下首先看一下,我取得的信息:下面我就把相关的C#的代码贴在下面,以方便有需要的朋友首先是在这过程中需要用到的一些API函数及声明Win32.cs:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;namespace ListT
阅读全文
摘要:以上就是程序执行时,所呈现的效果,这是经过自己摸索出来的一种解决方案,在网上也搜索过,但是有不少人在问,却没有多少明确的答案。所以在这里我把自己成功的方案给大伙share一下,我想应该有达人们比我有更好的法子。但我这已经完全实现了想要的效果,所以就在此抛出来,以此达到抛砖引玉的效果,如有更好的方案,希望与我交流。以下就贴上我的代码:功能是写在dll里的,所以比较通用!下面是我的BaseFunc.dll里的类文件Func.cs的代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;
阅读全文
摘要:C#中如何使用GetTcpTable API函数来取得本机的连接信息代码已经加了详细注释,我想有需要的同志一定会看得明白了 1 public class NativeFunc 2 { 3 [StructLayout(LayoutKind.Sequential)] 4 public class MIB_TCPROW 5 { 6 public int dwState; 7 public int dwLocalAddr; 8 public int dwLocalPort; 9 public in...
阅读全文