-
正则提取网页中的图片示例源码
正则提取网页中的图片示例源码
- 2014-04-01下载
- 积分:1
-
利用c#写的jpg拼图软件,可以随意剪切和拼接(钩子源码)
利用c#写的jpg拼图软件,可以随意剪切和拼接using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Diagnostics;using System.Runtime.InteropServices;namespace AutoDrawRect{ public class MouseHook { //好吧这个没有用到 private bool isSet; public bool IsSet { get { return isSet; } } //这个也没有用到 private int handleOfHook; public int HandleOfHook { get { return handleOfHook; } } //这个还是没有用到、、、淡定! private bool isStopMsg; public bool IsStopMsg { get { return isStopMsg; } set { isStopMsg = value; } } //自己定义了一个事件 放到Hook里面去 public delegate void MEventhandler(object sender, MouseInfoEventArys e); public event MEventhandler HooKMouseEvent; [DllImport("user32.dll")]//设置钩子 第二个参数为回调函数指针 public static extern int SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hmod, int dwThreadid); [DllImport("user32.dll")]//传递到下一个钩子 public static extern int CallNextHookEx(int hHook, int nCode, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")]//卸载钩子 public static extern bool UnhookWindowsHookEx(int hHook); [DllImport("kernel32.dll")]//获取模块句柄 public static extern IntPtr GetModuleHandle(string lpModuleName); public const int WH_MOUSE_LL = 14;//全局鼠标Hook 7是局部的 13全局键盘 2局部键盘 public delegate int HookProc(int nCode, IntPtr wParam, IntPtr lParam);//话说c#里面委托就是函数指针?、 private const int WM_LBUTTONDOWN = 0x201; //在Hook里面判断是否左键点下 private const int WM_RBUTTONUP = 0x205; //在Hook里面判断是否右键抬起 public struct POINT {//鼠标位置的结构体 public int x; public int y; } public struct MouseLLInfo {//全局鼠标Hook的结构体 public POINT pt; //其实这里可以用Point只是这个新建的类里面没有应用System.Windows.Forms(应该是这个) public int mouseData; public int flags; public int time; public int dwExtraInfo; } GCHandle gc;//好吧 话说就是应为这个东西害得我研究了两天 没有这个的话 程序运行一会儿就提示崩溃了 //因为垃圾回收期把我的回调函数当垃圾收了 所以运行程序的时候 一会儿就提示我 一个垃圾的回调导致程序崩溃 //在非托管调用托管的时候 必须保持托管代码的或活动性 大概就这个意思 反正就是被收废品的收了、害的我用.net3.5用其他方式设置Hook public int MouseHookProcedure(int nCode, IntPtr wParam, IntPtr lParam) {//这个就是回调函数了 if (nCode >= 0 && HooKMouseEvent != null) {//先判断是否事件被绑定(感觉有点多余的判断 丫的我不在上面绑定 我写Hook干嘛) //话说是把内存的什么什么转换成结构体 MouseLLInfo mouseInfo = (MouseLLInfo)Marshal.PtrToStructure(lParam, typeof(MouseLLInfo)); Btn btn = Btn.None; //自己定义的一个枚举 里面只有三个值 if (wParam == (IntPtr)WM_LBUTTONDOWN) { //如果左键被点下 btn = Btn.LeftDowm; } else if (wParam == (IntPtr)WM_RBUTTONUP) { //如果右键被抬起 btn = Btn.RightUp; } //好吧 我就不知道当时我怎么想的 在Hook里面获取的坐标 有负数的现象 所以在那边 我没用这个坐标 MouseInfoEventArys e = new MouseInfoEventArys(btn, mouseInfo.pt.x, mouseInfo.pt.y); HooKMouseEvent(this, e);//触发绑定到这个上面的事件 } return CallNextHookEx(handleOfHook, nCode, wParam, lParam);//继续下一个钩子 } public bool SetMouseHook() { //设置Hook if (isSet) {//如果已经设置了 就不要设置啦、、、 return false; } HookProc MouseCallBack = new HookProc(MouseHookProcedure); handleOfHook = SetWindowsHookEx(WH_MOUSE_LL, MouseCallBack, GetModuleHandle(Process.GetCurrentProcess().MainModule.ModuleName), 0); if (handleOfHook != 0) {//如果设置成功、、 gc = GCHandle.Alloc(MouseCallBack);//这个就是那个什么什么、、然后我的回调就不会被收废品的拣去了 isSet = true; return true; } return false; } public bool UnLoadMouseHook() { if (!isSet) {//如果装都没有装那么久不要卸载啦、、 return false; } if (UnhookWindowsHookEx(handleOfHook)) { gc.Free();//将回调释放掉、、 isSet = false; return true; } return false; } } public enum Btn//我只感觉到这三个有用、(应该是两个 左键点下 右键抬起) { LeftDowm, RightUp, None } public class MouseInfoEventArys {//话说定义事件的时候都是这么写的 所以我也弄一个内出来保存事件参数 private int x;//坐标 多余的后来才发现 鼠标慢慢贴近屏幕边缘的时候 3 2 1 0 -1 、、丫的 负数都出来了 public int X { get { return x; } } private int y;//坐标 public int Y { get { return y; } } private Btn mBtn; public Btn MBtn { get { return mBtn; }//鼠标的情况 } public MouseInfoEventArys(Btn btn,int x,int y) {//构造器 mBtn = btn; this.x = x; this.y = y; } }}
- 2013-12-22下载
- 积分:1
-
C# 常用类库源码下载(DotNet.Utilities)
C# 常用类库源码下载(DotNet.Utilities)
- 2020-11-21 12:19:35下载
- 积分:1
-
C# ftp 下载类源码
C# ftp 下载类源码
- 2013-11-28下载
- 积分:1
-
EzReportBuild 2.0报表组件源码和demo及说明
2.0版本添加了多报表页功能,每份报表可设置多页,每页可设置不同的纸张大小、数据表、页面规则等,并可对报表页次序即时调整,同时,优化了显示,报表显示更流畅。EzReportBuild 2.0报表组件,可以完成报表设计、预览、打印等功能,提供接口函数,可以将设计、预览等嵌入到自定的winform中调用,使用简单,调用灵活。在你的工程项目里,新建一个窗体,添加按钮,使用:// 单独打开报表编辑器 private void button1_Click(object sender, EventArgs e) { _Interface.independent_DesignForm(); }打开设计器设计报表,保存报表后可去掉按钮,该工程项目生成的报表,别的应用不能打开查看。如需复杂数据报表,可先生成一个临时数据库表,然后引入报表系统,由于报表数据为按行读取,所以只要能够设计出数据库各字段和内容,就能够生成相应的报表。打印规则为“内容区域”栏目无论所在位置,紧跟页头栏,所以适当调整“页头区域”、“页脚区域”位置,保证按需求输出。制作每页多行数据报表,“内容区域”为自动计算填充“页头区域”、“页脚区域”之间的空间,应适当调整“内容区域”栏目和页头页脚之间的空间,达到最佳打印效果。如需在表格内添加空行,可在生成的报表数据库表中添加空记录即可。 注意:使用时,将fontawesome-webfont.ttf字体文件与exe文件放置在一起,使用Access数据库时,注意路径,如没有安装AccessDatabaseEngine.exe,可在微软网站下载,或在本压缩文件的soft文件夹中安装。 更新关注:https://www.cnblogs.com/qiaoke/p/10365440.html 设计器截图 预览截图 嵌入程序截图 多种纸张同时预览using System;using System.Drawing;using System.Windows.Forms;namespace Demo_1{ public partial class Form1 : Form { RBuild_Interface _Interface = new RBuild_Interface(); // 新建接口 RBuild_Preview rpb = new RBuild_Preview(); // 预览窗口对象 public Form1() { InitializeComponent(); } // 单独打开报表编辑器 private void button1_Click(object sender, EventArgs e) { _Interface.independent_DesignForm(); } // 单独打开报表预览 private void button2_Click(object sender, EventArgs e) { _Interface.independent_PreviewForm(@"测试报表1.rpt", 2, "", "", "", "地址库.mdb"); } private void button3_Click(object sender, EventArgs e) { // 按钮可以使用 b1.Enabled = true; b2.Enabled = true; b3.Enabled = true; b4.Enabled = true; b5.Enabled = true; b6.Enabled = true; b7.Enabled = true; b8.Enabled = true; _Interface.embedded_PreviewForm(rpb, panel1, @"测试报表1.rpt", 2, "", "", "", "地址库.mdb", true); } private void b1_Click(object sender, EventArgs e) { _Interface.preview_FirstPage(rpb); } private void b2_Click(object sender, EventArgs e) { _Interface.preview_PreviousPage(rpb); } private void b3_Click(object sender, EventArgs e) { _Interface.preview_NextPage(rpb); } private void b4_Click(object sender, EventArgs e) { _Interface.preview_LastPage(rpb); } private void b5_Click(object sender, EventArgs e) { _Interface.preview_Search(new Point(200,200)); } private void b6_Click(object sender, EventArgs e) { _Interface.zoom_Menu(rpb,new Point(300,200)); } private void b7_Click(object sender, EventArgs e) { _Interface.print_Page(rpb); } private void b8_Click(object sender, EventArgs e) { int _now, _tol; _now = _Interface.get_NowPage(rpb); _tol = _Interface.get_TotalPage(); MessageBox.Show("当前页:" _now "--- 总页数:" _tol); } }}
- 2019-01-19下载
- 积分:1
-
统计word和Excel的页数
大量文档打印前,统计word和Excel的页数
- 2015-02-08下载
- 积分:1
-
wpf 病例管理系统源码下载(mvvm+sqlite 数据库)
wpf 病例管理系统源码下载(mvvm+sqlite 数据库)
- 2014-03-09下载
- 积分:1
-
bbcode 转换成 html 示例源码(亲测通过) discuz 帖子可用
如果你的bbcode含中文 需将这里改下: public static System.Text.RegularExpressions.Regex OptionRegex { get { //return new System.Text.RegularExpressions.Regex(@"(?[w]*)[s]*=[s]*(?[x25w/:/.-]*)", RegexOptions.Compiled); string strExp = @"(?[w]*)[s]*=[s]*(?[x25wsS/:/.-]*)"; return new System.Text.RegularExpressions.Regex(strExp, RegexOptions.Compiled); } }
- 2014-07-18下载
- 积分:1
-
解析
解析
- 2013-06-11下载
- 积分:1
-
仿QQ在屏幕边框隐藏窗口源码
仿QQ在屏幕边框隐藏窗口源码
- 2015-01-21下载
- 积分:1