C#功能实现
文章平均质量分 80
hcqi2004
这个作者很懒,什么都没留下…
展开
-
C# 强制关闭当前程序进程
函数:/// /// 运行DOS命令 /// DOS关闭进程命令(ntsd -c q -p PID )PID为进程的ID /// /// /// public static string RunCmd(string command) { //实例一个Process类,启动一个独立进程 System.Diagnostics.Process p = ne转载 2011-12-28 10:41:01 · 1558 阅读 · 0 评论 -
使用BackgroundWorker
使用BackgroundWorker 凡是WinForm的应用程序,如果他执行了一个的非常冗长的处理操作(比如文件查询),它在执行时会锁定用户界面,虽然主活动窗口 一直在运行,但用户无法与程序交互,无法移动窗体或改变窗体大小,所以用户感觉很不爽。如何做才能使得这个程序有响应。答案就是在后台线程中执行这个操作。 在这里已经有了多种方法来做这个事情: (一)委托异步调用转载 2011-12-28 10:55:58 · 630 阅读 · 0 评论 -
Dll中封装类
在DLL中封装类,如果要在外面调用其对象的话,要通过一个函数来返回该对象的值,创建过程和平时一样! 一、实验环境 本实例的编程工具及运行环境为:Windowsxp,visual studio 2008,Delphi 7二、实验内容1.用visual studio 2008建立一个动态链接库classdll.DLL,该库中封装了类Cclassdll。2.用Delphi编写测原创 2012-01-04 17:40:58 · 3161 阅读 · 0 评论 -
获取窗体中的“是”按钮
IntPtr p = new IntPtr(0); string[] alertName = new string[] { "安全警报", "安全警告", "Security alert" }; try { foreach (string item in alertName)转载 2012-02-17 10:07:01 · 633 阅读 · 0 评论 -
单例程序
using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using System.Diagnostics;using System.Runtime.InteropServices;namespace UCMenjinCtrServ{转载 2014-01-14 14:27:38 · 585 阅读 · 0 评论 -
获得汉字字符串拼音首字母
public static string GetUpperindexcode(string strText) { return indexcode(strText).ToUpper(); } //返回给定字符串的首字母 public static string indexcode(string ind转载 2014-02-16 12:46:02 · 814 阅读 · 0 评论