随笔分类 -  C#

c#中图片合并后保存的问题
摘要:pictureBox1.Image=Image.FromFile(@"E:\1.bmp");Graphics g=Graphics.FromImage(pictureBox1.Image);Pen p=new Pen(Color.Black,5);g.DrawLine(p,0,0,50,100); //这里可以画你的第二幅图片pictureBox1.Refresh();pictureBox1.Im... 阅读全文

posted @ 2004-10-14 16:37 LEE 阅读(1340) 评论(0) 推荐(0)

如何在2000和XP下添加用户
摘要:如何在2000和XP下添加用户A;private void AddUser(string strDoamin, string strLogin, string strPwd){ DirectoryEntry obDirEntry = null; try { obDirEntry = new DirectoryEntry("WinNT://" + strDoamin); DirectoryEntri... 阅读全文

posted @ 2004-10-14 16:33 LEE 阅读(1684) 评论(0) 推荐(0)

远程重启计算机
摘要:Q:远程重启计算机A;ConnectionOptions options = new ConnectionOptions ( ) ; options.Username ="administrator"; options.Password = "" ; ManagementScope scope = new ManagementScope( "\\\\" + "10.5.0.5" + "\\root... 阅读全文

posted @ 2004-10-14 16:33 LEE 阅读(927) 评论(0) 推荐(0)

读注册表
摘要:public static string GetPath(){string sPath;RegistryKey lRk_Path;lRk_Path = Registry.CurrentUser;//打开software目录RegistryKey software = lRk_Path.OpenSubKey("Software");RegistryKey odbc = software.OpenSu... 阅读全文

posted @ 2004-10-14 16:31 LEE 阅读(364) 评论(0) 推荐(0)

截系统热键
摘要:Q;截系统热键A;public class Win32Hook{[DllImport("kernel32")]public static extern int GetCurrentThreadId();[DllImport( "user32", CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]public stat... 阅读全文

posted @ 2004-10-14 16:30 LEE 阅读(447) 评论(0) 推荐(0)

C#捕捉视频
摘要:Q:C#捕捉视频\A:using System;using System.Runtime.InteropServices;namespace Wuyin.ShoesManager{ /// <summary> /// VedioCapture 的摘要说明。 /// </summary> public class VedioCapture { private int hCap... 阅读全文

posted @ 2004-10-14 16:26 LEE 阅读(897) 评论(1) 推荐(0)

C#中调用WIN32 API实现对光驱的操作
摘要:Q:C#中调用WIN32 API实现对光驱的操作A:using System; using System.Text;using System.Windows.Forms;using System.Drawing;using System.Runtime.InteropServices;class CDRomControler:Form{ [DllImport( "winmm.dll", Entry... 阅读全文

posted @ 2004-10-14 16:25 LEE 阅读(603) 评论(0) 推荐(0)

等待外部程序运行结束以后 主程序再继续运行
摘要:Q:等待外部程序运行结束以后 主程序再继续运行A:System.Diagnostics.Process p = Process.Start("IExplore.exe", "www.northwindtraders.com");p.WaitForExit();if(p.ExitCode==0)//正常退出{...} 阅读全文

posted @ 2004-10-14 16:24 LEE 阅读(604) 评论(0) 推荐(0)

c#关机
摘要:你可以这样来实现:(支持Win XP下的关机)using System.Runtime.InteropServices; [StructLayout(LayoutKind.Sequential, Pack=1)] internal struct TokPriv1Luid { public int Count; public long Luid; public int A... 阅读全文

posted @ 2004-10-14 08:53 LEE 阅读(1646) 评论(0) 推荐(0)

远程启动
摘要:这里是个远程启动的例子,参考一下吧using System ; using System.Drawing ; using System.Collections ; using System.ComponentModel ; using System.Windows.Forms ; using System.Data ; using System.Management ; ... 阅读全文

posted @ 2004-10-14 08:52 LEE 阅读(501) 评论(0) 推荐(0)

关于COM+
摘要:关于C#中COM+的使用大致是这样的:COM+需要服务器端和客户端,个人意见COM+更合适于B/S系统中。 关于服务器构造是这样的: 1、首先新建一个类库。(这里我们把它命名为TestCom) 它会生成两个文件,AssemblyInfo.cs和Class1.cs 2、添加新类( server.cs ) 3、添加引用( System.EnterpriseServices )... 阅读全文

posted @ 2004-10-12 14:55 LEE 阅读(726) 评论(1) 推荐(0)

在开发 WinForm 控件时,通常需要测量文本绘出时的实际尺寸。
摘要:阅读要求:了解 C# 调用 Win32API 的基本原理和操作方式 在开发 WinForm 控件时,通常需要测量文本绘出时的实际尺寸。.NET FCL 中的 GDI+ 类——System.Drawing.Graphics 提供了用于上述需要的 MeasureString 方法,该方法返回了一个 SizeF 结构的浮点数表示的结果,从表面上看起来似乎很精确,但在实际使用中发... 阅读全文

posted @ 2004-10-11 17:35 LEE 阅读(540) 评论(0) 推荐(0)

导航