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

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - miao~

C# 截取1位小数 扩展老赵的 直接通过User Control生成HTML 分页功能 小技巧在Repeater控件中找到对应模板内的控件 大型互联网网站架构心得之一:分 UML 序列图 sql存储过程教程 Create an ASP.NET AJAX Style Folder Explorer BS程序代码与安全与基本攻击/防御模式 利用 .NET 3.5 的 Syndication 相关类生成 RSS RSS2.0规范 利用 .NET 3.5 的 Syndication 相关类读取 RSS Feeds 使用linq to xml 快速创建自己的Rss 代码设计简单规范 VS.PHP 在Visual Studio 下的 PHP 开发 IDE 工具 窥探jQuery——面向JavaScript程序员 开发一个适合Ajax+JSON+jQuery环境使用的多功能页码栏——jPagerBar-1.1.1 最实用的12条css技巧 不错的下拉列表.HTML控件和服务器控件都可以使用 两个粒度看Asp.net生命周期
ASP.NET 获取MSN联系人列表
miao~ · 2008-07-22 · via 博客园 - miao~

用到的是 DOTMSN 大家可以从 这里 下到它的代码....

功能很简单...写的有点槽了...不过功能是实现了....

HTML

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    
<title>无标题页</title>
    
<style type="text/css">
    ul
{ list-style:none; padding:0; margin:0;}
    
</style>
</head>
<body>
    
<form id="form1" runat="server">
    
<div align="center">
        
<ul>
        
<li>
        用户名:
<asp:TextBox ID="txtUserID" runat="server"></asp:TextBox>
        
</li>
         
<li>
         密
&nbsp;&nbsp;&nbsp; 码:<asp:TextBox ID="txtPassWd" TextMode="Password" runat="server"></asp:TextBox>    
        
</li>
        
</ul>
        
<asp:Button ID="Button1" runat="server" Text="登陆" onclick="Button1_Click" />
        
<br />
        
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
        
<br />
        
<hr />
        
<asp:ListBox Height="200" ID="ListBox1" runat="server" SelectionMode="Multiple"></asp:ListBox>
    
</div>
    
</form>
</body>
</html>

CS

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections.Generic;
using XihSolutions.DotMSN;
using XihSolutions.DotMSN.Core;
using XihSolutions.DotMSN.DataTransfer;

public partial class _Default : System.Web.UI.Page 
{
    
private XihSolutions.DotMSN.Messenger messenger = new Messenger();
    
protected void Page_Load(object sender, EventArgs e)
    
{

    }

    
protected void Button1_Click(object sender, EventArgs e)
    
{
        messenger.Credentials.ClientID 
= "msmsgs@msnmsgr.com";
        messenger.Credentials.ClientCode 
= "Q1P7W2E4J9R8U3S5";

        
try
        
{
            
if (messenger.Connected)
            
{
                lblMessage.Text 
= "Disconnecting from server";
                messenger.Disconnect();
            }



            messenger.Credentials.Account 
= txtUserID.Text;
            messenger.Credentials.Password 
= txtPassWd.Text;

        
            lblMessage.Text 
= "Connecting to server";
            messenger.Connect();

            lblMessage.Text 
= "connected successful";

            
//网络传输慢所以叫他先睡会,写的有点糙了。。。不过基本功能实现了。。。
            System.Threading.Thread.Sleep(5000);

            
foreach (Contact contact in messenger.ContactList.All)
            
{
                ListItem item 
= new ListItem();

                
//这个是获取联系人 名称的
                
//item.Text = contact.Name;

                
//这个是获取联系人 Mail的
                item.Text = contact.Mail;
                ListBox1.Items.Add(item);
            }

            ListBox1.DataBind();

        }

        
catch { }
    }

}

您还可以点 这里 下载全部代码.