C#开发的whois查询客户端(原创)

 C#开发的whois查询客户端,对喜欢抢注域名的朋友有一定的帮助。

WINFORM版本效果图如下

                                    图一、SharpWhois WinForm 版本

                               图二、whois命令行版本

现在要查询域名的话就不用打开一些无聊的网站了。

软件下载:点击下载(扩展名改为rar下同)

源码下载:点击下载

ChangLog 2006-8-3日调整部分代码,使得CN形式域名中文信息显示正常,详见代码。效果如下图所示

                                            图三、支持中文显示(采用UTF8编码)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
DDE(Dynamic Data Exchange)是一种在 Windows 操作系统中使用的进程间通信(IPC)机制。使用DDE,一个应用程序可以向另一个应用程序发送数据或请求数据。在C#中,可以使用System.Windows.Forms命名空间中的DdeClient类来实现DDE客户端。 以下是一个简单的DDE客户端示例,它将连接到Microsoft Excel并获取单元格A1的值: ```csharp using System; using System.Windows.Forms; using System.Runtime.InteropServices; using System.Security.Permissions; namespace DDEClientExample { public partial class Form1 : Form { private const int WM_DDE_ACK = 0x03; private const int WM_DDE_DATA = 0x05; [DllImport("user32.dll")] private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] protected override void WndProc(ref Message m) { if (m.Msg == WM_DDE_DATA) { // Get the data from the DDE server string data = Marshal.PtrToStringAuto(m.LParam); // Display the data MessageBox.Show(data); } else if (m.Msg == WM_DDE_ACK) { // The DDE server has acknowledged our connection request MessageBox.Show("Connected to DDE server."); } base.WndProc(ref m); } public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { // Connect to Microsoft Excel DdeClient ddeClient = new DdeClient("excel", "sheet1"); // Subscribe to the DDE server's events ddeClient.Disconnected += DdeClient_Disconnected; ddeClient.Advise += DdeClient_Advise; // Connect to the DDE server ddeClient.Connect(); // Request data from the DDE server byte[] data = ddeClient.Request("A1"); // Disconnect from the DDE server ddeClient.Disconnect(); } private void DdeClient_Disconnected(object sender, EventArgs e) { MessageBox.Show("Disconnected from DDE server."); } private void DdeClient_Advise(object sender, DdeAdviseEventArgs e) { // Handle DDE advise events here } } } ``` 在此示例中,我们使用 DdeClient 类连接到 Microsoft Excel 的“sheet1”工作表,并使用 Request 方法获取单元格 A1 的值。我们还订阅了 DDE 服务器的 Disconnected 和 Advise 事件。 请注意,DDE 已经过时,Microsoft 建议使用其他通信机制,例如 COM、.NET Remoting 或 WCF。如果可能的话,应该尽量避免使用 DDE。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值