C#
文章平均质量分 71
相思梦
这个作者很懒,什么都没留下…
展开
-
C# 取活动网卡IP地址
private List IPActiveAddress { get { var IPAddressCollection = new List(0); var Collection = Dns.GetHostAddresses(Dns.GetHostName());原创 2014-06-24 17:12:07 · 1056 阅读 · 0 评论 -
C# 语法之美 Lambda 表达式
当委托只有一个参数时,可以这样写原创 2014-06-15 19:40:57 · 533 阅读 · 0 评论 -
C# 读HTTP文件(API)
此代码可以解决很多不必要的问题,上次的XMLHTTP读文件的方式,容易出现在没网时出现错误,所以另发一个using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using Sys原创 2014-06-16 21:58:32 · 1728 阅读 · 0 评论 -
C# INI Profile 操作
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace students{ public abstract class Profile { [DllImportAttribute("kern原创 2014-06-15 12:09:38 · 824 阅读 · 0 评论 -
C# 位运算
位与6 & 3 0000 0110&0000 0011 相同取真、不同取假0000 0010位或6 | 3 110|011----- 一真得真 111异或6 ^ 3 110^011----- 相同取假、不同取真 101取反 ~6 = -7; // 反转二进制右移6 >> 1 = 3 110原创 2014-06-15 22:38:10 · 540 阅读 · 0 评论 -
C# DOS回显(匿名管道Pipe)
// 起初打算采用CreatePipe创建匿名管道来着,不过却无法得到原创 2014-07-26 14:28:53 · 2268 阅读 · 1 评论 -
C# 指针
stackalloc原创 2014-06-17 23:47:43 · 559 阅读 · 0 评论 -
C# 序列化实现类的深拷贝
// [Serializable] 标记在类上方,我的这串代码就可以使用了原创 2014-08-02 02:46:44 · 671 阅读 · 0 评论 -
C# 监控网络流量 MIB_IF_TABLE2
通过原创 2014-06-16 13:13:06 · 2086 阅读 · 0 评论 -
C# VBRegExp10
namespace Active{ using System; using System.Reflection; using System.Collections.Generic; public class RegExp { object ComObject; Type ComType; void Inint()原创 2014-07-12 02:37:01 · 670 阅读 · 0 评论 -
C# Hex(16进制转换算法)
static string Byte2Hex(byte wbyte) { string ret = null; var arr = "0123456789ABCDEF"; var len = arr.Length; ret += arr[wbyte / len].ToStrin原创 2014-10-04 22:43:14 · 1528 阅读 · 0 评论 -
C# COM SAPI.SpVoice 对象类封装(微软娘TTS引擎)
我不是太喜欢说东西,直接贴代码原创 2014-06-14 16:29:23 · 4572 阅读 · 0 评论 -
C# 遍历XML节点到TreeView
private void Form1_Load(object sender, EventArgs e) { this.SuspendLayout(); var treeView1 = new TreeView(); treeView1.Dock = DockStyle.Fill;原创 2014-06-15 17:26:44 · 963 阅读 · 0 评论 -
C# 枚举进程模块
// namespace eMod{ using System; using IO = System.IO; using System.Collections.Generic; using System.Text; using System.Diagnostics; using System.Runtime.InteropServ原创 2014-07-17 19:18:48 · 3045 阅读 · 0 评论 -
C# PicBtn Control 图形按钮
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropService原创 2014-06-28 14:12:37 · 729 阅读 · 0 评论 -
C# Net/Win32 内存操作
using System;using System.Collections.Generic;using System.Text;using System.Runtime.InteropServices;namespace std{ public partial class Memory : Object { [DllImportAttribute("k原创 2014-06-14 17:07:42 · 1033 阅读 · 0 评论 -
C# 通过HWND获取IE的IWebBrowser2接口
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Runtime.InteropService原创 2014-06-14 17:31:00 · 1971 阅读 · 0 评论 -
C# 取字符串像素宽度
示列代码:原创 2014-06-14 18:10:38 · 1195 阅读 · 0 评论 -
C# 模拟按键
最近发现个有趣的问题,我们如何向一个程序发送 按键指令?嗯,我稍微总结了下,大概有如下几种: 1:System.Windows.Forms.SendKeys. Send / SendWait示例: SendKeys.SendWait("^{A}"); // 模拟键:CTRL + A组合键: Ctrl = ^ Shift = +原创 2014-06-15 12:52:36 · 2551 阅读 · 0 评论 -
C# 网页放大缩小(WebBrowser && AxWebBrowser)
Net / WebBrowser var HTMLDocument = webBrowser1.Document; HTMLDocument.Body.Style = "ZOOM:0.5"; // 缩小原创 2014-06-15 18:00:37 · 7987 阅读 · 0 评论 -
C+/CLR/C# 十到十六进制文本
C++ char* Byte2Hex(unsigned char Byte) { char _s[] = { '0', '1', '2','3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; char* _ret = new char[0x2]; _ret[0x0] = _s[Byte /原创 2014-06-15 22:04:16 · 522 阅读 · 0 评论 -
C# 寻找文件(FindNextFile)
[Serializable, StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto), BestFitMapping(false)] struct WIN32_FIND_DATA { public int dwFileAttributes; publi原创 2014-06-15 13:26:23 · 1189 阅读 · 0 评论 -
C# XMLHTTP 读文件
本来想用API写的不过最后还是算了,原创 2014-06-14 19:02:06 · 1018 阅读 · 0 评论 -
C# GC垃圾自动回收(陷阱)
测试类代码: public class Demo : IDisposable { ~Demo() { MessageBox.Show("释放非托管资源"); } public void Dispose() {原创 2014-11-19 22:13:00 · 3581 阅读 · 0 评论