ICode9

精准搜索请尝试: 精确搜索
  • 获取windows操作系统所有用户2019-11-19 16:52:56

    一、知识点简单介绍 1. 利用WindowsApi获取 [DllImport("Netapi32.dll ")] extern static int NetUserEnum([MarshalAs(UnmanagedType.LPWStr)] string servername, int level, int filter, out IntPtr bufptr, int prefmaxlen, out int entriesread, out int totalentries, out

  • Net实现钩子函数(Hook)以及通过SendMessage实现自动点击按钮和给文本框赋值2019-10-06 15:51:51

    原文:Net实现钩子函数(Hook)以及通过SendMessage实现自动点击按钮和给文本框赋值 1.实现钩子函数 钩子(Hook)的实现需要三个主要的函数和一个委托 [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]public static extern in

  • 跨 Appdomain 数据共享2019-09-09 16:50:50

    using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Runtime.InteropServices;using System.Diagnostics;using System.Text;namespace SGSMWebTest{ public partial c

  • WinFrom系统长时间不操作则进行关闭+关闭窗口倒计时2019-09-05 16:01:49

    标题:WinFrom系统长时间不操作则进行关闭+关闭窗口倒计时 1.首先在界面添加两个timer 2.在窗体运行是开启第一个timer 3.( 0x0202://鼠标左键UP,0x0205://鼠标右键UP,0x0203://鼠标左键双击,case 0x201://鼠标左键Down,case 0x100://键盘按下) public Form7() { InitializeCompo

  • txt操作2019-09-04 11:53:54

    C#解决读写包含汉字的txt文件时乱码的问题 C#解决读写包含汉字的txt文件时乱码的问题 当我们用System.IO.StreamReader读取包含汉字的txt文件时,经常会读出乱码(StreamWriater写文本文件也有类似的问题),原因很简单,就是文件的编码(encoding)和StreamReader/Writer的encoding不对应。

  • C# 判断(Excel)文件是否已经打开2019-08-22 09:41:59

    using System.IO; using System.Runtime.InteropServices;   [DllImport("kernel32.dll")] public static extern IntPtr _lopen(string lpPathName, int iReadWrite);   [DllImport("kernel32.dll")] public static extern bool CloseHandle(IntPtr hObj

  • [C#]访问共享文件夹或者磁盘(需要用户名密码)2019-08-16 20:00:10

    有项目要求使用对方本地管理员访问访问对方D盘,网上找到一段API,刚开始可以使用一段时间,升级到1903就失效了,一脸懵逼啊 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace ConsoleA

  • CLR 4.0 拾遗系列1.1 System.AccessViolationException2019-08-11 15:01:27

    原文链接:http://www.cnblogs.com/pagsun/archive/2011/04/08/clr4_system_access_violation_exception.html Namespace: System   Class: System.AccessViolationException   Remarks: An access violation occurs in unmanaged or unsafe code when

  • 水晶报表攻克系列3-如何在程序中自定义纸张2019-08-10 14:05:09

    原文链接:http://www.cnblogs.com/MarkRao/archive/2012/10/30/cr3.html 水晶报表攻克系列3-如何在程序中自定义纸张   大家都知道电脑里会有预定义好的纸张,例如A4。但是最近做发票,快递单时,纸张大小需要自定义。   例如: 1 ReportDocument doc =

  • C#关闭一个特定的窗体(关闭特定的消息框或者普通窗体)2019-08-04 22:03:36

    原文链接:https://www.cnblogs.com/jearay/p/3620260.html /* 关闭一个消息窗体 ,title是窗体的名称*/ public static void KillMessageBox(string title) { //按照MessageBox的标题,找到MessageBox的窗口 IntPtr

  • 仿制shazzam的简单功能,将hlsl转换为WPF中的ShaderEffect2019-07-27 15:06:32

    (此文章只是在对WPF的Effect产生兴趣才稍微研究了一点后面的知识;需要了解更多可参考https://archive.codeplex.com/?p=shazzam的源代码以及WPF基础知识) 1.之前一直使用blend里自带的几个特效,突然有一天比较好奇这些特效是怎么来的。   然后就听说了shazzam并看到更多的特效 2.在

  • c# 调用User32.dll2019-07-23 23:01:32

    获取当前窗口句柄:GetForegroundWindow()[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]public static extern IntPtr GetForegroundWindow();使用方法   IntPtr myPtr=GetForegroundWindow(); [DllImport("kernel32.dll")] static

  • Parse MSI installers by call MSI database [C#]2019-07-21 16:08:28

    原文链接:http://www.cnblogs.com/skywind/archive/2011/11/17/2252617.html Purpose: Parse MSI installer, to get information such as product name, product code, properties etc. MSI is a standard windows install techonoly, so there are APIs

  • hearthbuddy中的Class2762019-07-14 12:00:08

    构造函数 需要注意的是this.intptr_0 = this.method_18("mono.dll"); 所以,这个类里面的操作,最后是和mono.dll相关的 internal Class276(ExternalProcessMemory memory) { this.externalProcessMemory_0 = memory; this.intptr_0 = this.method_18("m

  • Messagebox自定义计时关闭2019-07-10 18:00:23

    Messagebox自定义计时关闭   新建Winform项目WindowsFormsAppTESTMessageBoxAutoClose 主窗体代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Runtime.InteropServices; using

  • c# – 用户创建的像素字节数组似乎无法正确更新(WPF)2019-07-08 23:06:44

    我有一个系统,我可以从相机收集8位灰色图像,将数据放入WriteableBitmap并在WPF图像对象上显示图像.这项工作发生在相机线程中.我用这篇文章来帮助我:How to create a BitmapImage from a pixel byte array (live video display) 我想要做的是复制图像数据的像素数据的子集.在相机线

  • IntPtr2019-07-07 13:06:28

     IntPtr 一:什么是IntPtr    先来看看MSDN上说的:用于表示指针或句柄的平台特定类型。这个其实说出了这样两个事实,IntPtr 可以用来表示指针或句柄、它是一个平台特定类型。对于它的解释,这个哥们写的比较好:It's a class that wraps a pointer that is used when call

  • 从C#传递字符串到c dll2019-07-04 01:52:13

    我在c#应用程序中使用c dll时遇到了一些麻烦.给我一个错误的函数在dll的头文件中定义,如下所示: int __stdcall DDC_CreateFilePropertyString (DDCFileHandle file, const char *property, con

  • C# 弹出USB外接硬盘(U盘)2019-06-29 17:00:13

    原文:C# 弹出USB外接硬盘(U盘)最近一个项目需要通过代码来弹出USB外接硬盘设备,经过google找到了下面这个类库: http://www.codeproject.com/Articles/13530/Eject-USB-disks-using-C 不过这个类库只能在x86下使用,因此需要修改以下内容,使其适用于x64平台 修改DeviceClass为以下代码: pu

  • CefSharp在高DPI的屏幕上出现黑边(winform)2019-06-28 14:39:24

    目录 问题现象 解决办法 1.将cefsharp的gpu设置为无效,(后遗症,h5动画会出现卡顿现象,慎用) 2.将屏幕的DPI置为96(缩放比例为100%)(后遗症,不可能每个电脑都去配置) 3.支持高DPI(后遗症,winform窗体会缩放) 4.(采用)让整个程序支持高DPI   回到顶部 问题现象 如图所示:在高DPI(168) 缩放比例为

  • 抓取SSL加密的网页(https),含证书验证2019-06-21 09:48:19

    因为项目需要,需从向HTTPS页面发送一些数据并获取返回的数据。普通的http网页好办,直接用HttpWebRequest就可以轻松实现。如果对方网页是HTTP但需要登录后才能查看的,也不难实现:用HttpWebRequest加上身份信息构造一个HTTP基层协议内容,再和服务器来一次往返提取到SessionID然后发送

  • 如何绕过AMSI2019-06-16 22:03:05

      0x00 前言 AMSI的全称是反恶意软件扫描接口(Anti-Malware Scan Interface),是从Windows 10开始引入的一种机制。AMSI是应用程序和服务能够使用的一种接口,程序和服务可以将“数据”发送到安装在系统上的反恶意软件服务(如Windows Defender)。 在基于场景的资产评估或者基于数据的

  • .Net读取共享文件夹的通用方法2019-05-31 08:50:50

    定义类: 1 public class ShareFolderHelper : IDisposable 2 { 3 //Obtains user token 4 [DllImport("advapi32.dll", SetLastError = true)] 5 static extern bool LogonUser(string pszUsername, string pszDomain, string

  • C# 基于Arcface SDK实现人脸识别和注册2019-05-30 13:38:47

    整个项目使用虹软技术完成开发 一,准备工作 1.Afoge视频参数类 using AForge.Video.DirectShow;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace FaceRecognization.Common{public class CameraPara{/

  • C# 判断程序是否执行 进行启动或前台显示2019-05-28 15:03:30

    #region 显示程序 [DllImport("user32.dll", EntryPoint = "FindWindow")] public static extern int FindWindow(string lpClassName, string lpWindowName); /// <summary> /// 该函数设置由不同线程产生的窗口的显示状态。 ///

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有