![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.NET
文章平均质量分 54
abc221414
这个作者很懒,什么都没留下…
展开
-
使用zip32.dll,ZIP32J.DLL,UNZIP32.DLL进行压缩和解压zip文件
首先,需要准备好题目中必须得的3个dll文件。可以在网络中搜索并下载。 然后,我习惯把他们放在工程的debug目录下。 以下是代码: public static class ZipManager { //锁定对象 private static readonly object m_oLockObject = new object();原创 2011-12-09 16:24:36 · 3517 阅读 · 2 评论 -
VB.NET 使用其他用户启动程序
Imports System.Runtime.InteropServices Imports System.Text Public Class RunAs Private Const LOGON_WITH_PROFILE = 1 Private Const LOGON_NETCREDENTIALS_ONLY = 2 Private Const CREATE_DEFAULT原创 2012-05-04 13:39:15 · 1249 阅读 · 0 评论 -
C# 使用其他用户启动程序
一下代码转载自CodeProject,经过删减: /// /// Logon option. /// [FlagsAttribute] public enum LogonFlags { /// /// Log on, then load the user's profile in the HKEY_USERS registry key. The fun转载 2012-05-04 13:36:33 · 1273 阅读 · 0 评论 -
.net中启动其他exe文件
一、VB.net 采用Shell命令如下: Dim ProcId As Integer ProcId = Shell(fileFullName, AppWinStyle.NormalFocus) 二、C# 采用Process.Start : ProcessStartInfo startInfo = new ProcessStartInfo(fileFullName); start原创 2012-04-08 10:38:42 · 1715 阅读 · 0 评论 -
使用Net Use命令打开连接
''' ''' ''' ''' ''' ''' ''' ''' Public Shared Function ConnectToServer(ByVal Server As String, ByVal UserName As String, ByVal Password As String) As String原创 2012-03-19 15:22:33 · 797 阅读 · 0 评论 -
SizeOf与Marshal.SizeOf的区别
在程序中,对于值类型,使用SizeOf 对于引用类型,或者含有引用类型的值类型(比如结构体),就需要使用Marshal.SizeOf了。原创 2012-02-02 14:16:11 · 721 阅读 · 0 评论 -
C#取得正在运行的程序的数量
[DllImport("user32", SetLastError = true)] public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); [DllImport("User32.dll")] extern static I原创 2012-02-02 14:24:52 · 1460 阅读 · 0 评论 -
C#中,使用wininet.dll中的InternetSetOption设置FTP访问超时时间
API定义: [DllImport("wininet.dll", EntryPoint = "InternetSetOptionA", CharSet = CharSet.Ansi, SetLastError = true, PreserveSig = true)] public static extern bool InternetSetOption(int hIntern原创 2012-02-02 14:21:18 · 5267 阅读 · 0 评论 -
C#FTP操作
使用系统自带的wininet.dll,对FTP进行文件的查询,下载,上传,文件夹遍历操作。 /// /// /// public static class APIs { [DllImport("wininet.dll")] public static extern int InternetOpen(string lps原创 2011-12-29 10:55:02 · 3599 阅读 · 0 评论 -
压缩文件格式判定
public int GetFileType(string filePath) { int result = 0; if (File.Exists(filePath) == false) { return 0; } try原创 2011-12-29 09:18:05 · 984 阅读 · 0 评论 -
Region.IsVisible长时间执行,无法取得结果
使用Region.IsVisible,判断一个领域中是否包含一个点。 在XP中,一切正常。但是在Windows Server 2003中的时候,方法长时间无法返回结果(执行时间长达几个小时)。 原因是前一次Region.Isvisible执行之后,没有消除Region对象,从而导致该方法若干次执行之后,无法得出结果。原创 2011-12-16 10:47:46 · 906 阅读 · 0 评论 -
vb.net 取得应用程序的启动路径
当程序保存在局域网中的某个邻居上面的时候,可以用如下的语句取得实际的保存路径: GetStartUpPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase原创 2012-05-04 09:26:17 · 1933 阅读 · 0 评论