惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
V
Vulnerabilities – Threatpost
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
人人都是产品经理
人人都是产品经理
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
美团技术团队
aimingoo的专栏
aimingoo的专栏
Google Online Security Blog
Google Online Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threatpost
Y
Y Combinator Blog
T
Tailwind CSS Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
小众软件
小众软件
Recent Commits to openclaw:main
Recent Commits to openclaw:main
T
Tenable Blog
W
WeLiveSecurity
L
LINUX DO - 热门话题
D
Docker
Cyberwarzone
Cyberwarzone
量子位
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
The Hacker News
The Hacker News
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
O
OpenAI News
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
IT之家
IT之家
S
Secure Thoughts
MongoDB | Blog
MongoDB | Blog
L
Lohrmann on Cybersecurity
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News

博客园 - 让心灵去旅行

在Javascript中用command模式模拟多线程,包含注释 项目小结 sql语句性能提高 oracle的异常 XP风格进度条 随机抽取不重复的数据 xmlhttp实现无刷新页面 VS.Net 2005中文版下载地址收藏 在线统计与跟踪(新) 简单ocx控件制作方法(原创) 自己做控件小例子 可以双击的DataGrid 权限管理的方案(只有实现思想) 收藏几段SQL Server语句和存储过程(转载) 动态添加和删除行 键盘各键对应的键值 只能输入数值的输入框 操作动态表格的控件 模仿QQ的菜单滚动效果
简单的消息发送小程序
让心灵去旅行 · 2005-12-09 · via 博客园 - 让心灵去旅行

借用命令行发送消息机制实现,十分简单,废话不说,贴代码吧

using System.Runtime.InteropServices;

public int SendMessage(string sFrom,string sTo,string sMessage)
{
 
byte[] bBuffer = System.Text.Encoding.Unicode.GetBytes(sMessage);
 
int nRet = NetMessageBufferSend(null,sTo,sFrom,sMessage,sMessage.Length*2+2);
            
return nRet;
        }


[DllImport (
"Netapi32", CharSet=CharSet.Unicode)] 
public static extern int NetMessageBufferSend( string servername, string msgname, string fromname, string buf, int buflen);

//调用举例
int a = SendMessage(Request.UserHostName.ToString(),tbx_sendto.Text.Trim(),tbx_message.Value.ToString());