net读取exchange数据

大部分的参考是来自MSDN:

http://msdn.microsoft.com/en-us/library/exchangewebservices(EXCHG.80).aspx

2007版的Exchange服务器提供了webservice,我们可以方便的在.NET程序中添加该引用,然后就可以方便的实现邮件的抓取,发送,删除等功能。我测试是在控制台程序中使用该webservice,步骤如下:

1 新建一个站点,然后添加 exchange webservice 的引用, 输入邮件服务器的 OWA 地址:http://yourmailserver/EWS/Services.wsdl ,如果是在公司的内部域中,添加的过程中要求输入你的域帐号和密码。

 

 

 

 

 

2 添加成功以后再项目中导入该命名空间以其他必须的命名空间 ;

 

 

3 下面就是具体的代码,具体的请看注释:

发送邮件:

 

 1           public   static   void  CreateEmail( string  userName,  string  passWord,  string  domain,  string  url,  string  mailFrom,  string  mailTo)
 2             {
 3               //  Create service binding.
 4               //  建立service绑定
 5              ExchangeServiceBinding esb  =   new  ExchangeServiceBinding();
 6              esb.Credentials  =   new  NetworkCredential(userName, passWord, domain);
 7              esb.Url  =  url;
 8 
 9               //  Create the CreateItem request.
10              CreateItemType createItemRequest  =   new  CreateItemType();
11 
12               //  Specifiy how the created items are handled
13               //  如何处理邮件
14              createItemRequest.MessageDisposition  =  MessageDispositionType.SendAndSaveCopy;
15              createItemRequest.MessageDispositionSpecified  =   true ;
16 
17               //  Specify the location of sent items. 
18              createItemRequest.SavedItemFolderId  =   new  TargetFolderIdType();
19              DistinguishedFolderIdType sentitems  =   new  DistinguishedFolderIdType();
20              sentitems.Id  =  DistinguishedFolderIdNameType.sentitems;
21              createItemRequest.SavedItemFolderId.Item  =  sentitems;
22 
23               //  Create the array of items.
24              createItemRequest.Items  =   new  NonEmptyArrayOfAllItemsType();
25 
26               //  Create a single e-mail message.
27               //  新建一封邮件message对象
28              MessageType message  =   new  MessageType();
29              message.Subject  =   " Tommy Test " ;
30              message.Body  =   new  BodyType();
31              message.Body.BodyType1  =  BodyTypeType.Text;
32              message.Body.Value  =   " This is tommy's test use exchange webservice " ;
33              message.ItemClass  =   " IPM.Note " ;
34              message.Sender  =   new  SingleRecipientType();
35              message.Sender.Item  =   new  EmailAddressType();
36              message.Sender.Item.EmailAddress  =  mailFrom;
37              message.ToRecipients  =   new  EmailAddressType[ 1 ];
38              message.ToRecipients[ 0 ]  =   new  EmailAddressType();
39              message.ToRecipients[ 0 ].EmailAddress  =  mailTo;
40              message.Sensitivity  =  SensitivityChoicesType.Normal;
41 
42               //  Add the message to the array of items to be created.
43              createItemRequest.Items.Items  =   new  ItemType[ 1 ];
44              createItemRequest.Items.Items[ 0 ]  =  message;
45 
46               try
47                 {
48                   //  Send the request to create and send the e-mail item, and get the response.
49                  CreateItemResponseType createItemResponse  =  esb.CreateItem(createItemRequest);
50 
51                   //  Determine whether the request was a success.
52                   if  (createItemResponse.ResponseMessages.Items[ 0 ].ResponseClass  ==  ResponseClassType.Error)
53                     {
54                       throw   new  Exception(createItemResponse.ResponseMessages.Items[ 0 ].MessageText);
55                  }
56                   else
57                     {
58                      Console.WriteLine( " Item was created " );
59                      Console.ReadLine();
60                  }
61              }
62               catch  (Exception e)
63                 {
64                  Console.WriteLine(e.Message);
65                  Console.ReadLine();
66              }
67          }
 

抓取以及删除邮件:

  1    public   static   void  GetMailMessage( string  userName,  string  passWord,  string  domain,  string  url)
  2             {
  3               //  绑定exchange服务器
  4              ExchangeServiceBinding exchangeServer  =   new  ExchangeServiceBinding();
  5              ICredentials creds  =   new  NetworkCredential(userName, passWord, domain);
  6 
  7               //  建立信任连接
  8              exchangeServer.Credentials  =  creds;
  9              exchangeServer.Url  =  url;
 10 
 11               //  定义邮件的收件箱
 12              DistinguishedFolderIdType[] folderIDArray  =   new  DistinguishedFolderIdType[ 1 ];
 13              folderIDArray[ 0 ]  =   new  DistinguishedFolderIdType();
 14              folderIDArray[ 0 ].Id  =  DistinguishedFolderIdNameType.inbox;
 15 
 16              PathToUnindexedFieldType ptuftDisplayName  =   new  PathToUnindexedFieldType();
 17              ptuftDisplayName.FieldURI  =  UnindexedFieldURIType.folderDisplayName;
 18 
 19              PathToExtendedFieldType pteftComment  =   new  PathToExtendedFieldType();
 20              pteftComment.PropertyTag  =   " 0x3004 " ;  //  PR_COMMENT
 21              pteftComment.PropertyType  =  MapiPropertyTypeType.String;
 22 
 23               //  定义GetFolderType对象,设置相应属性
 24              GetFolderType myfoldertype  =   new  GetFolderType();
 25              myfoldertype.FolderIds  =  folderIDArray;
 26              myfoldertype.FolderShape  =   new  FolderResponseShapeType();
 27              myfoldertype.FolderShape.BaseShape  =  DefaultShapeNamesType.IdOnly;
 28              myfoldertype.FolderShape.AdditionalProperties  =   new  BasePathToElementType[ 2 ];
 29              myfoldertype.FolderShape.AdditionalProperties[ 0 ]  =  ptuftDisplayName;
 30              myfoldertype.FolderShape.AdditionalProperties[ 1 ]  =  pteftComment;
 31 
 32               //  获取服务器中的文件夹的集合
 33              GetFolderResponseType myFolder  =  exchangeServer.GetFolder(myfoldertype);
 34 
 35               //  获取收件箱
 36              FolderInfoResponseMessageType firmtInbox  =
 37                  (FolderInfoResponseMessageType)myFolder.ResponseMessages.Items[ 0 ];
 38 
 39               //  显示收件箱
 40              Console.WriteLine( string .Format( " got folder: {0} " , firmtInbox.Folders[ 0 ].DisplayName));
 41 
 42 
 43              PathToUnindexedFieldType ptuftSubject  =   new  PathToUnindexedFieldType();
 44              ptuftSubject.FieldURI  =  UnindexedFieldURIType.itemSubject;
 45 
 46              PathToUnindexedFieldType ptuftBody  =   new  PathToUnindexedFieldType();
 47              ptuftBody.FieldURI  =  UnindexedFieldURIType.itemAttachments;
 48 
 49              PathToExtendedFieldType pteftFlagStatus  =   new  PathToExtendedFieldType();
 50              pteftFlagStatus.PropertyTag  =   " 0x1090 " ;  //  PR_FLAG_STATUS
 51              pteftFlagStatus.PropertyType  =  MapiPropertyTypeType.Integer;
 52 
 53               //  定义FindItemType对象,准备获取收件箱中的集合
 54              FindItemType findItemRequest  =   new  FindItemType();
 55              findItemRequest.Traversal  =  ItemQueryTraversalType.Shallow;
 56              findItemRequest.ItemShape  =   new  ItemResponseShapeType();
 57              findItemRequest.ItemShape.BaseShape  =  DefaultShapeNamesType.AllProperties;
 58 
 59 
 60              findItemRequest.ParentFolderIds  =   new  FolderIdType[ 1 ];
 61              findItemRequest.ParentFolderIds[ 0 ]  =  firmtInbox.Folders[ 0 ].FolderId;
 62 
 63               //  获取邮件
 64              FindItemResponseType firt  =  exchangeServer.FindItem(findItemRequest);
 65 
 66               //  循环迭代每一封邮件
 67               foreach  (FindItemResponseMessageType firmtMessage  in  firt.ResponseMessages.Items)
 68                 {
 69                   //  如果包含邮件,显示出来
 70                   if  (firmtMessage.RootFolder.TotalItemsInView  >   0 )
 71                     {
 72                       //  循环迭代每一封邮件详细信息
 73                       foreach  (ItemType it  in  ((ArrayOfRealItemsType)firmtMessage.RootFolder.Item).Items)
 74                         {
 75                          Console.WriteLine( string .Format( " 邮件标题: {0}  " , it.Subject));
 76                          Console.WriteLine( string .Format( " 发件人: {0}  " ,((MessageType)(it)).From.Item.Name));
 77                          Console.WriteLine( string .Format( " 收件人: {0}  " , it.DisplayTo));
 78                          Console.WriteLine( string .Format( " 抄送: {0}  " , it.DisplayCc));
 79                          Console.WriteLine( string .Format( " 大小: {0}  " , it.Size.ToString()));
 80                          Console.WriteLine( string .Format( " 重要性: {0}  " , it.Importance.ToString()));
 81                          Console.WriteLine( string .Format( " 是否已读: {0}  " , ((MessageType)(it)).IsRead.ToString()));
 82                          Console.WriteLine( string .Format( " 是否有附件: {0}  " , it.HasAttachments.ToString()));
 83                           // Console.WriteLine(string.Format("发送时间:{0}", it.DateTimeSent.ToString()));
 84                          Console.WriteLine( string .Format( " 接收时间: {0}  " , it.DateTimeReceived.ToString()));
 85                         
 86                         
 87                           //  通过GetItemType对象来得到邮件的正文
 88                          GetItemType getItemRequest  =   new  GetItemType();
 89                           //  设置必要的属性
 90                          getItemRequest.ItemIds  =   new  BaseItemIdType[ 1 ];
 91                          getItemRequest.ItemIds[ 0 ]  =  (BaseItemIdType)it.ItemId;
 92                          getItemRequest.ItemShape  =   new  ItemResponseShapeType();
 93                          getItemRequest.ItemShape.BaseShape  =  DefaultShapeNamesType.AllProperties;
 94                          getItemRequest.ItemShape.IncludeMimeContent  =   true ;
 95 
 96                           //  获得服务器的相应
 97                          GetItemResponseType getItemResponse  =  exchangeServer.GetItem(getItemRequest);
 98 
 99                           //  得到邮件体
100                          ItemInfoResponseMessageType getItemResponseMessage  =
101                                                getItemResponse.ResponseMessages.Items[ 0 ]  as
102                                                ItemInfoResponseMessageType;
103 
104                           //  显示邮件正文
105                          Console.WriteLine( " 邮件格式:{0} " , getItemResponseMessage.Items.Items[ 0 ].Body.BodyType1);
106                          Console.WriteLine( string .Format( " 正文:{0} " , getItemResponseMessage.Items.Items[ 0 ].Body.Value));
107 
108                           //  获取当前邮件的附件集合
109                           if  (getItemResponseMessage.Items.Items[ 0 ].HasAttachments)
110                             {
111                              AttachmentType[] attachments  =  getItemResponseMessage.Items.Items[ 0 ].Attachments;
112 
113                               //  循环获取当前邮件的每一个附件
114                               for  ( int  i  =   0 ; i  <=  attachments.Length  -   1 ;i ++  )
115                                 {
116                                   //  定义GetAttachmentType,设置相应的属性,进行模式验证来获取附件
117                                  GetAttachmentType getAttachment  =   new  GetAttachmentType();
118                                  RequestAttachmentIdType[] attachmentIDArry  =   new  RequestAttachmentIdType[ 1 ];
119                                  attachmentIDArry[ 0 ]  =   new  RequestAttachmentIdType();
120                                  attachmentIDArry[ 0 ].Id  =  attachments[i].AttachmentId.Id;
121                                  getAttachment.AttachmentIds  =  attachmentIDArry;
122                                  getAttachment.AttachmentShape  =   new  AttachmentResponseShapeType();
123                                 
124                                   //  获取附件
125                                  GetAttachmentResponseType getAttachmentResponse  =  exchangeServer.GetAttachment(getAttachment);
126 
127                                   //  返回服务器的响应对象
128                                  AttachmentInfoResponseMessageType responseMessage  =  getAttachmentResponse.ResponseMessages.Items[ 0 ]  as  AttachmentInfoResponseMessageType;
129                                   if  (responseMessage  !=   null )
130                                     {
131                                       //  没有异常,显示附件信息
132                                       if  (responseMessage.ResponseClass  ==  ResponseClassType.Success  &&  responseMessage.Attachments  !=   null
133                                                              &&  responseMessage.Attachments.Length  >   0 )
134                                         {
135                                          AttachmentType attachment  =  responseMessage.Attachments[ 0 ];
136                                          Console.WriteLine( " 附件名:{0}\n " , attachment.Name);
137                                           // Console.WriteLine("附件类型:{0}\n", attachment.ContentId);                                                    
138                                      }
139                                  }
140                              }
141                          }
142 
143                           //  删除当前邮件
144                          DeleteItemType deleteItem  =   new  DeleteItemType();
145                          deleteItem.ItemIds  =   new  BaseItemIdType[ 1 ];
146 
147                           //  将要删除邮件的ID,changekey赋值给ItemIdType对象
148                          ItemIdType itemIDType  =   new  ItemIdType();
149                          itemIDType.Id  =  it.ItemId.Id;
150                          itemIDType.ChangeKey  =  it.ItemId.ChangeKey;
151 
152                          deleteItem.ItemIds[ 0 ]  =  itemIDType;
153 
154                           //  执行删除
155                          DeleteItemResponseType deleteResponse  =  exchangeServer.DeleteItem(deleteItem);
156 
157                           //  删除成功
158                           if  (deleteResponse.ResponseMessages.Items.Length  >   0   &&  deleteResponse.ResponseMessages.Items[ 0 ].ResponseClass  ==  ResponseClassType.Success)
159                             {
160                              Console.WriteLine( " 删除成功 " );
161                          }
162                         
163                      }
164                  }
165 
166              }
167          }

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/thy822/archive/2010/09/09/5873244.aspx

 

 

 

 

 

 

 

 

 

 

 

第一次做webdav方法读取excahnge邮件方面的东西,将网上查找到的代码改成了.ascx控件,后台代码如下:

 

代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.Data;
using System.Xml;

namespace SharePoint.Exchange2003
{
    
public class unreadmailcontrol : UserControl
    {
        GridView GridView1;

        
protected void Page_Load(object sender, EventArgs e)
        {
            
try
            {
                GridView1 
= (GridView)this.FindControl("GridView1");
                GridView1.DataSource 
= GetUnReadMail();
                GridView1.DataBind();
            }
            
catch (Exception ex)
            {

            }
        }

        
private DataTable GetUnReadMail()
        {
            
string url = "http://ip/exchange/"//指定Exchange服务器地址 
            System.Net.HttpWebRequest Request;
            System.Net.WebResponse Response;
            System.Net.CredentialCache MyCredentialCache;
            
string strUserName = "administrator"//指定登录的用户名
            string strRootURI = url + strUserName.Trim() + "/收件箱/"//得到要访问邮箱的WebDAV地址
            string strPassword = "test"//指定该用户的密码
            string strDomain = "test"//指定域名
            string strQuery = "";
            
byte[] bytes = null;
            System.IO.Stream RequestStream 
= null;
            System.IO.Stream ResponseStream 
= null;
            XmlDocument ResponseXmlDoc 
= null;
            XmlNodeList HrefNodes 
= null;
            XmlNodeList SizeNodes 
= null;

            
int count = 0;
            
try
            {

                
// 用SQL查询WebDAV返回结果中的unreadcount节点.
                
//strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" >"
                
// + "<D:sql>SELECT \"DAV:displayname\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:unreadcount\" FROM \"" + strRootURI + "\""
                
// + "</D:sql></D:searchrequest>";
                strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" >"
                   
+ "<D:sql>SELECT \"urn:schemas:httpmail:importance\",\"urn:schemas:httpmail:from\",\"urn:schemas:httpmail:read\",\"urn:schemas:httpmail:datereceived\",\"urn:schemas:httpmail:subject\",\"urn:schemas:httpmail:hasattachment\","
                   
+ "\"DAV:contentclass\",\"DAV:getcontentlength\",\"DAV:displayname\""
                   
+ "FROM \"" + strRootURI + "\""
                   
+ "WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false"
                   
+ "</D:sql></D:searchrequest>";


                
// 创建新的CredentialCache对象,构建身份凭据
                MyCredentialCache = new System.Net.CredentialCache();
                MyCredentialCache.Add(
new System.Uri(strRootURI),
                 
"NTLM",
                 
new System.Net.NetworkCredential(strUserName, strPassword, strDomain)
                 );

                
// Create the HttpWebRequest object.
                Request = (System.Net.HttpWebRequest)HttpWebRequest.Create(strRootURI);

                
// 指定HttpWebRequest的身份凭据,此处为关键所在。如果使用之前
                
// 创建的MyCredentialCache,则这个身份凭据是可以从Web服务器传递
                
// 到Exchange服务器的,但是这样带来的问题也很明显,就是不能够自
                
// 动获取当前登录到域的用户的身份。即便已经成功登录到域,那也只
                
// 能通过form再次输入用户名密码。因此,我在这里用的是
                
// Request.Credentials = CredentialCache.DefaultCredentials,
                
// 这样便可以获得当前用户的凭据,但是这样带来的问题便是上面提到的
                
// 身份凭据无法传递的问题,解决方法请关注下篇文章。
                Request.Credentials = MyCredentialCache;

                
// 指定WebDAV的SEARCH方法
                Request.Method = "SEARCH";

                
// Encode the body using UTF-8.
                bytes = Encoding.UTF8.GetBytes((string)strQuery);

                
// Set the content header length. This must be
                
// done before writing data to the request stream.
                Request.ContentLength = bytes.Length;

                
// Get a reference to the request stream.
                RequestStream = Request.GetRequestStream();

                
// Write the SQL query to the request stream.
                RequestStream.Write(bytes, 0, bytes.Length);

                
// Close the Stream object to release the connection
                
// for further use.
                RequestStream.Close();

                
// Set the content type header.
                Request.ContentType = "text/xml";

                
// Send the SEARCH method request and get the
                
// response from the server.
                Response = (HttpWebResponse)Request.GetResponse();

                
// Get the XML response stream.
                ResponseStream = Response.GetResponseStream();

                
// 创建XmlDocument对象,并获取收件箱的unreadcount节点的值
                ResponseXmlDoc = new XmlDocument();
                ResponseXmlDoc.Load(ResponseStream);
                
//HrefNodes = ResponseXmlDoc.GetElementsByTagName("a:displayname");
                
//SizeNodes = ResponseXmlDoc.GetElementsByTagName("d:unreadcount");
                
//for (int i = 0; i < HrefNodes.Count; i++)
                
//{
                
//    if (HrefNodes[i].InnerText == "收件箱")
                
//        count = int.Parse(SizeNodes[i].InnerText);
                
//}
                
//ResponseStream.Close();
                
//Response.Close();
                XmlNodeList idNodes = ResponseXmlDoc.GetElementsByTagName("a:displayname");
                XmlNodeList SenderNodes 
= ResponseXmlDoc.GetElementsByTagName("d:from");
                XmlNodeList importanceNodes 
= ResponseXmlDoc.GetElementsByTagName("d:importance");
                XmlNodeList contextclassNodes 
= ResponseXmlDoc.GetElementsByTagName("a:contentclass");
                XmlNodeList readNodes 
= ResponseXmlDoc.GetElementsByTagName("d:read");
                XmlNodeList datareceiveNodes 
= ResponseXmlDoc.GetElementsByTagName("d:datereceived");
                XmlNodeList subjectNodes 
= ResponseXmlDoc.GetElementsByTagName("d:subject");
                XmlNodeList getcontentlengthNodes 
= ResponseXmlDoc.GetElementsByTagName("a:getcontentlength");
                XmlNodeList hasattachmentNodes 
= ResponseXmlDoc.GetElementsByTagName("d:hasattachment");
                XmlNodeList hrefNodes 
= ResponseXmlDoc.GetElementsByTagName("a:href");


                DataTable dt 
= new DataTable();

                dt.Columns.Add(
"Subject");
                dt.Columns.Add(
"Href");
                dt.Columns.Add(
"Time");
                dt.Columns[
"Time"].DataType = Type.GetType("System.DateTime");

                
for (int j = 0; j < readNodes.Count; j++)
                {
                    
//if (readNodes[j].InnerText == "1")continue;//只取未读邮件



                    dt.Rows.Add(subjectNodes[j].InnerText, hrefNodes[j].InnerText, DateTime.Parse(datareceiveNodes[j].InnerText));

                }
                ResponseStream.Close();
                Response.Close();


                
return dt;
            }
            
catch
            {
                
return null;
            }

        }
    }
}

 

前台展示页面(.ascx)如下:

 

代码
<%@ Control Language="C#"  Inherits="SharePoint.Exchange2003.unreadmailcontrol, SharePoint.Exchange2003, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7da4c70ffa3a2438" %>

  
<style type="text/css">
        img
        {
            border
-style: none;
        }
        body
        {
            font
-size: 12px;
        }
        .td
        {
        }
        a
        {
            text
-decoration: none;
            color: #
616161;
        }
        #header
        {
            width: 225px;
            height: 20px;
            background
-repeat: no-repeat;
            background
-image: url(/_layouts/images/header.png);
            padding
-left: 180px;
            padding
-top: 4px;
        }
        #header a
        {
            color: #B88A00;
        }
        #dataTable
        {
            height: 259px;
            width: 223px;
            border
-style: solid;
            border
-width: 1px;
            border
-color: Gray;
        }
        #mainDiv
        {
            
        }
    
</style>
   
  
<div id="mainDiv">
        
<div id="header">
            
<a href="http://ip/exchange/" target="_blank">更多...</a></div>
        
<div id="dataTable">
            
<asp:GridView ID="GridView1" runat="server" ShowHeader="False" AutoGenerateColumns="False"
                Width
="223px" RowStyle-Height="23px" RowStyle-CssClass="td" AllowPaging="True"
                BorderColor
="#CCCCCC" BorderStyle="Groove">
                
<PagerSettings Visible="False" />
                
<RowStyle CssClass="td" Height="23px"></RowStyle>
                
<Columns>
                    
<asp:TemplateField ShowHeader="False">
                        
<ItemTemplate>
                            
<img alt="" src="/_layouts/images/email.jpg" />
                        
</ItemTemplate>
                        
                    
</asp:TemplateField>
                    
<asp:TemplateField ShowHeader="False" ItemStyle-Height="23">
                        
<ItemTemplate>
                            
<div style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden; width: 145px;
                                padding-left: 3px;">
                                <a id="LinkButton1" runat="server" href='<%# DataBinder.Eval(Container.DataItem, "Href") %> '
                                    target
="_blank">
                                    
<%# DataBinder.Eval(Container.DataItem, "Subject"%>
                                
</a>
                            
</div>
                        
</ItemTemplate>
                        
<ItemStyle Height="23px"></ItemStyle>
                    
</asp:TemplateField>
                    
<asp:BoundField DataField="Time" DataFormatString="{0:MM-dd}">
                        
<ItemStyle Width="45px" ForeColor="Gray" Font-Names="Verdana" HorizontalAlign=" Center"
                            Font
-Size="10px"></ItemStyle>
                    
</asp:BoundField>
                
</Columns>
            
</asp:GridView>
        
</div>
    
</div>

转载于:https://www.cnblogs.com/ahjxxy/archive/2010/11/14/1876887.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/298912.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

第十周项目1-程序填充与阅读(三)

/**Copyright (c) 2014,烟台大学计算机学院*All gight reserved.*文件名称&#xff1a;temp.cpp*作者&#xff1a;邵帅*完成时间&#xff1a;2014年10月30日*版本号&#xff1a;v1.0 */ #include <iostream> #include <cstdio> using namespace std; int main( ) {…

20以内究竟包不包括20?

全世界只有3.14 % 的人关注了爆炸吧知识本文转载自微信公众号一只学霸&#xff08;ID&#xff1a;bajie203&#xff09;学霸今天要问你们一个问题起初我看到微博上讨论这个的时候我觉得这个问题挺智障的然后点开评论一看……Wtf居然两个评论完全相反&#xff1f;&#xff1f;再…

一篇文章带你分清楚JWT,JWS与JWE

随着移动互联网的兴起&#xff0c;传统基于session/cookie的web网站认证方式转变为了基于OAuth2等开放授权协议的单点登录模式&#xff08;SSO&#xff09;&#xff0c;相应的基于服务器session浏览器cookie的Auth手段也发生了转变&#xff0c;Json Web Token出现成为了当前的热…

这五大基础原理,总是牛逼的无话可说

▲ 点击查看关于这几年很火的STEM教育理念&#xff0c;相信大家早就不陌生了。之前小木推荐读的这类读物&#xff0c;一般都是加上艺术&#xff08;ART&#xff09;的STEAM的5大学科。但是最近小木发现了这套以4大主要学科为主的《英国儿童经典STEM丛书》&#xff0c;不但有艺术…

androidstudio学习总结_Android 开发工程师自述:2年的开发,我总结了7条经验

全文共3547字&#xff0c;预计学习时长11分钟“纸上得来终觉浅&#xff0c;绝知此事要躬行。”“没有调查就没有发言权。”“实践出真知。”古今中外&#xff0c;无数名言警句都告诉我们实际去做一件事的重要性。笔者从最初对安卓开发萌生兴趣到现在已有两年之久了&#xff0c;…

php抓取统计局区划代码,抓取国家统计局的代码和名称,爬取,区域,划分,及

from bs4 import BeautifulSoupimport pandas as pdimport requestsheaders {User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36}获取一级代码、名称、下一级链接通过设置参数originUrl来调…

XMPP聊天之Openfire 的安装和配置---Mac OS

2019独角兽企业重金招聘Python工程师标准>>> 一、下载并安装openfire 1、下载最新的openfire安装文件 官方下载站点&#xff1a;http://www.igniterealtime.org/downloads/index.jsp#openfire openfire是服务器&#xff0c;下面还有一个spark&#xff0c;这个是一…

物理学十大著名经典实验!你知道几个?

科学实验是物理学发展的基础&#xff0c;又是检验物理学理论的惟一手段&#xff0c;特别是现代物理学的发展&#xff0c;更和实验有着密切的联系。现代实验技术的发展&#xff0c;不断地揭示和发现各种新的物理现象&#xff0c;日益加深人们对客观世界规律的正确认识&#xff0…

5码默认版块_5个小众的生活学习类的宝藏App

今天分享 5 个宝藏 App &#xff0c;每一个都是小众冷门&#xff0c;每一个都是自己用心挑选&#xff0c;相信可以让你眼前一亮。所有 App 下载方法文章末尾提供。1 卡片日记卡片日记是一个颜值极高的卡片日记软件&#xff0c;它备受好评&#xff0c;可以说你用过就知道好用&am…

CSS/DIV网页设计视频教程目录【转】

CSS/DIV网页设计视频教程目录 欢迎您来到前沿视频教室&#xff0c;下面列出的是CSS/DIV网页设计视频教程列表。这组视频教程是配合《精通CSSDIV网页样式与布局》图书制作的&#xff0c;每一课对应于图书中的每一章。 我们还会不断地推出相关的课程&#xff0c; 如果您有兴趣&am…

世界上最伟大的十大公式

▲ 点击查看英国科学期刊《物理世界》曾让读者投票评选了“最伟大的公式”&#xff0c;最终榜上有名的十个公式既有无人不知的112&#xff0c;又有著名的Emc^2&#xff1b;既有简单的-圆周公式&#xff0c;又有复杂的欧拉公式……这些公式不仅仅是数学家和物理学家的智慧结晶&a…

区块链浏览器_全球首款区块链浏览器是啥名堂?傲游6首发体验

[PConline 应用]沉寂多年的傲游浏览器终于准备发布大版本更新了&#xff0c;这次为大家带来的是傲游浏览器6&#xff0c;一个被官方称为“世界第一个区块链浏览器”的新版本&#xff0c;那么&#xff0c;有何特色呢&#xff1f;我们一起来看看吧。傲游浏览器6(后简称傲游6)在安…

ASP.NET Core官方文档+源码,这样学效率高10倍!

.NET Framework停更一年了&#xff0c;学习.NET Core跨平台是大势所趋。如何快速学习ASP.NET Core&#xff1f;在我看来&#xff0c;先看微软ASP.NET Core5.0官方中文文档&#xff0c;再大致读一遍源码&#xff0c;最后结合一些场景做些扩展封装&#xff0c;就可以很轻松的驾驭…

WPF 2D绘图(2)Geometry

Shape是对Geometry的一种封装,Shape本质上还是通过绘制Geometry的形状,然后以填充笔刷来呈现效果 如Rectangle <Path Stroke"Black" StrokeThickness"1" Fill"#CCCCFF"><Path.Data><RectangleGeometry Rect"30,55 100 30&qu…

Windows Server 2008 R2 之三十故障转移群集(二)

五、群集的管理破坏群集&#xff1a;一个两节点的群集&#xff0c;对于第一个节点必须在“节点”中选择“退出”才能退出群集&#xff1b;对于第二个节点&#xff0c;必须在下图选择“破坏群集”才能退出群集。配置服务和应用程序&#xff1a;节点&#xff1a;存储&#xff1a;…

提升心力---摆脱拿着锤子看啥都是钉子

从程序员到一个团队的管理者&#xff0c;这中间需要经过一次又一次的蜕变&#xff0c;最终才能变得处理任何事情都得心应手。韩非子曾说&#xff1a;下君用己之力、中君用人之力、上君用人之智。大部分的管理者可能都处在用人之力的阶段&#xff0c;并向着用人之智前进。最近看…

curd什么意思中文_每日一句英译英:She's a ten什么意思?

每日一句英译英&#xff1a;Shes a ten什么意思&#xff1f;用一句“没头没脑”的英语句子劈头盖脑就问你“中文什么意思&#xff1f;“&#xff0c;这是典型的把英语当纯粹知识学习的例子&#xff0c;也是“只求答案&#xff0c;不问过程”的应试思维模式。“知识海洋”浩瀚无…

你家猫砸东西是不是也专挑贵的砸?

1 这猫也太会了吧&#xff1f;▼2 哥哥坐地上耍赖想让爸爸抱被妹妹出手摆平了▼3 好可爱的校车▼4 也许人家只是想静静呢&#xff1f;▼5 最近很流行的【泼花成画】▼6 妹妹的表情简直学到了精髓▼7 介绍一下&#xff0c;这是一只阿拉斯猪和阿拉斯小猪崽儿▼你点的每个赞…

SQL Server 分区表 处理海量数据

你是不是也在苦苦寻求优化自己的SQL Server数据库的方法?如果你的数据库里有不少非常大的表格&#xff0c;分区功能能够帮到你很大的忙…… 【IT专家网独家】你是不是也在苦苦寻求优化自己的SQL Server数据库的方法?如果你的数据库里有不少非常大的表格&#xff0c;分区功能能…

第十一周项目3-程序的多文件组织

下面的程序中的代码分别保存在两个文件中&#xff0c;利用多文件的方式组织。 mian.cpp /**Copyright (c) 2014,烟台大学计算机学院*All gight reserved.*文件名称&#xff1a;temp.cpp*作者&#xff1a;邵帅*完成时间&#xff1a;2014年11月5日*版本号&#xff1a;v1.0 */ #in…