亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? netsendappender.cs

?? 詳細講述了數(shù)據(jù)庫編程
?? CS
字號:
#region Copyright & License
//
// Copyright 2001-2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#endregion

// MONO 1.0 Beta mcs does not like #if !A && !B && !C syntax

// .NET Compact Framework 1.0 has no support for Win32 NetMessageBufferSend API
#if !NETCF 
// MONO 1.0 has no support for Win32 NetMessageBufferSend API
#if !MONO 
// SSCLI 1.0 has no support for Win32 NetMessageBufferSend API
#if !SSCLI
// We don't want framework or platform specific code in the CLI version of log4net
#if !CLI_1_0

using System;
using System.Globalization;
using System.Runtime.InteropServices;

using log4net.Util;
using log4net.Layout;
using log4net.Core;


namespace log4net.Appender 
{
	/// <summary>
	/// Logs entries by sending network messages using the 
	/// <see cref="NetMessageBufferSend" /> native function.
	/// </summary>
	/// <remarks>
	/// <para>
	/// You can send messages only to names that are active 
	/// on the network. If you send the message to a user name, 
	/// that user must be logged on and running the Messenger 
	/// service to receive the message.
	/// </para>
	/// <para>
	/// The receiver will get a top most window displaying the 
	/// messages one at a time, therefore this appender should 
	/// not be used to deliver a high volume of messages.
	/// </para>
	/// <para>
	/// The following table lists some possible uses for this appender :
	/// </para>
	/// <para>
	/// <list type="table">
	///     <listheader>
	///         <term>Action</term>
	///         <description>Property Value(s)</description>
	///     </listheader>
	///     <item>
	///         <term>Send a message to a user account on the local machine</term>
	///         <description>
	///             <para>
	///             <paramref name="Server"/> = &lt;name of the local machine&gt;
	///             </para>
	///             <para>
	///             <paramref name="Recipient"/> = &lt;user name&gt;
	///             </para>
	///         </description>
	///     </item>
	///     <item>
	///         <term>Send a message to a user account on a remote machine</term>
	///         <description>
	///             <para>
	///             <paramref name="Server"/> = &lt;name of the remote machine&gt;
	///             </para>
	///             <para>
	///             <paramref name="Recipient"/> = &lt;user name&gt;
	///             </para>
	///         </description>
	///     </item>
	///     <item>
	///         <term>Send a message to a domain user account</term>
	///         <description>
	///             <para>
	///             <paramref name="Server"/> = &lt;name of a domain controller | uninitialized&gt;
	///             </para>
	///             <para>
	///             <paramref name="Recipient"/> = &lt;user name&gt;
	///             </para>
	///         </description>
	///     </item>
	///     <item>
	///         <term>Send a message to all the names in a workgroup or domain</term>
	///         <description>
	///             <para>
	///             <paramref name="Recipient"/> = &lt;workgroup name | domain name&gt;*
	///             </para>
	///         </description>
	///     </item>
	///     <item>
	///         <term>Send a message from the local machine to a remote machine</term>
	///         <description>
	///             <para>
	///             <paramref name="Server"/> = &lt;name of the local machine | uninitialized&gt;
	///             </para>
	///             <para>
	///             <paramref name="Recipient"/> = &lt;name of the remote machine&gt;
	///             </para>
	///         </description>
	///     </item>
	/// </list>
	/// </para>
	/// <para>
	/// <b>Note :</b> security restrictions apply for sending 
	/// network messages, see <see cref="NetMessageBufferSend" /> 
	/// for more information.
	/// </para>
	/// </remarks>
	/// <example>
	/// <para>
	/// An example configuration section to log information 
	/// using this appender from the local machine, named 
	/// LOCAL_PC, to machine OPERATOR_PC :
	/// </para>
	/// <code lang="XML" escaped="true">
	/// <appender name="NetSendAppender_Operator" type="log4net.Appender.NetSendAppender">
	///     <server value="LOCAL_PC" />
	///     <recipient value="OPERATOR_PC" />
	///     <layout type="log4net.Layout.PatternLayout" value="%-5p %c [%x] - %m%n" />
	/// </appender>
	/// </code>
	/// </example>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public class NetSendAppender : AppenderSkeleton 
	{
		#region Member Variables

		/// <summary>
		/// The DNS or NetBIOS name of the server on which the function is to execute.
		/// </summary>
		private string m_server;

		/// <summary>
		/// The sender of the network message.
		/// </summary>
		private string m_sender;

		/// <summary>
		/// The message alias to which the message should be sent.
		/// </summary>
		private string m_recipient;

		/// <summary>
		/// The security context to use for privileged calls
		/// </summary>
		private SecurityContext m_securityContext;

		#endregion

		#region Constructors

		/// <summary>
		/// Initializes the appender.
		/// </summary>
		/// <remarks>
		/// The default constructor initializes all fields to their default values.
		/// </remarks>
		public NetSendAppender() 
		{
		}

		#endregion

		#region Properties

		/// <summary>
		/// Gets or sets the sender of the message.
		/// </summary>
		/// <value>
		/// The sender of the message.
		/// </value>
		/// <remarks>
		/// If this property is not specified, the message is sent from the local computer.
		/// </remarks>
		public string Sender 
		{
			get { return m_sender; }
			set { m_sender = value; }
		}

		/// <summary>
		/// Gets or sets the message alias to which the message should be sent.
		/// </summary>
		/// <value>
		/// The recipient of the message.
		/// </value>
		/// <remarks>
		/// This property should always be specified in order to send a message.
		/// </remarks>
		public string Recipient 
		{
			get { return m_recipient; }
			set { m_recipient = value; }
		}
		
		/// <summary>
		/// Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute.
		/// </summary>
		/// <value>
		/// DNS or NetBIOS name of the remote server on which the function is to execute.
		/// </value>
		/// <remarks>
		/// <para>
		/// For Windows NT 4.0 and earlier, the string should begin with \\.
		/// </para>
		/// <para>
		/// If this property is not specified, the local computer is used. 
		/// </para>
		/// </remarks>
		public string Server 
		{
			get { return m_server; }
			set { m_server = value; }
		}

		/// <summary>
		/// Gets or sets the <see cref="SecurityContext"/> used to call the NetSend method.
		/// </summary>
		/// <value>
		/// The <see cref="SecurityContext"/> used to call the NetSend method.
		/// </value>
		/// <remarks>
		/// <para>
		/// Unless a <see cref="SecurityContext"/> specified here for this appender
		/// the <see cref="SecurityContextProvider.DefaultProvider"/> is queried for the
		/// security context to use. The default behavior is to use the security context
		/// of the current thread.
		/// </para>
		/// </remarks>
		public SecurityContext SecurityContext 
		{
			get { return m_securityContext; }
			set { m_securityContext = value; }
		}

		#endregion

		#region Implementation of IOptionHandler

		/// <summary>
		/// Initialize the appender based on the options set.
		/// </summary>
		/// <remarks>
		/// <para>
		/// This is part of the <see cref="IOptionHandler"/> delayed object
		/// activation scheme. The <see cref="ActivateOptions"/> method must 
		/// be called on this object after the configuration properties have
		/// been set. Until <see cref="ActivateOptions"/> is called this
		/// object is in an undefined state and must not be used. 
		/// </para>
		/// <para>
		/// If any of the configuration properties are modified then 
		/// <see cref="ActivateOptions"/> must be called again.
		/// </para>
		/// <para>
		/// The appender will be ignored if no <see cref="Recipient" /> was specified.
		/// </para>
		/// </remarks>
		/// <exception cref="ArgumentNullException">The required property <see cref="Recipient" /> was not specified.</exception>
		public override void ActivateOptions()
		{
			base.ActivateOptions();
	
			if (this.Recipient == null) 
			{
				throw new ArgumentNullException("Recipient", "The required property 'Recipient' was not specified.");
			}

			if (m_securityContext == null)
			{
				m_securityContext = SecurityContextProvider.DefaultProvider.CreateSecurityContext(this);
			}
		}

		#endregion

		#region Override implementation of AppenderSkeleton

		/// <summary>
		/// This method is called by the <see cref="AppenderSkeleton.DoAppend(LoggingEvent)"/> method.
		/// </summary>
		/// <param name="loggingEvent">The event to log.</param>
		/// <remarks>
		/// <para>
		/// Sends the event using a network message.
		/// </para>
		/// </remarks>
		protected override void Append(LoggingEvent loggingEvent) 
		{
			NativeError nativeError = null;

			// Render the event in the callers security context
			string renderedLoggingEvent = RenderLoggingEvent(loggingEvent);

			using(m_securityContext.Impersonate(this))
			{
				// Send the message
				int returnValue = NetMessageBufferSend(this.Server, this.Recipient, this.Sender, renderedLoggingEvent, renderedLoggingEvent.Length * Marshal.SystemDefaultCharSize);   

				// Log the error if the message could not be sent
				if (returnValue != 0) 
				{
					// Lookup the native error
					nativeError = NativeError.GetError(returnValue);
				}
			}

			if (nativeError != null)
			{
				// Handle the error over to the ErrorHandler
				ErrorHandler.Error(nativeError.ToString() + " (Params: Server=" + this.Server + ", Recipient=" + this.Recipient + ", Sender=" + this.Sender + ")");
			}
		}

		/// <summary>
		/// This appender requires a <see cref="Layout"/> to be set.
		/// </summary>
		/// <value><c>true</c></value>
		/// <remarks>
		/// <para>
		/// This appender requires a <see cref="Layout"/> to be set.
		/// </para>
		/// </remarks>
		override protected bool RequiresLayout
		{
			get { return true; }
		}

		#endregion

		#region Stubs For Native Function Calls

		/// <summary>
		/// Sends a buffer of information to a registered message alias.
		/// </summary>
		/// <param name="serverName">The DNS or NetBIOS name of the server on which the function is to execute.</param>
		/// <param name="msgName">The message alias to which the message buffer should be sent</param>
		/// <param name="fromName">The originator of the message.</param>
		/// <param name="buffer">The message text.</param>
		/// <param name="bufferSize">The length, in bytes, of the message text.</param>
		/// <remarks>
		/// <para>
		/// The following restrictions apply for sending network messages:
		/// </para>
		/// <para>
		/// <list type="table">
		///     <listheader>
		///         <term>Platform</term>
		///         <description>Requirements</description>
		///     </listheader>
		///     <item>
		///         <term>Windows NT</term>
		///         <description>
		///             <para>
		///             No special group membership is required to send a network message.
		///             </para>
		///             <para>
		///             Admin, Accounts, Print, or Server Operator group membership is required to 
		///             successfully send a network message on a remote server.
		///             </para>
		///         </description>
		///     </item>
		///     <item>
		///         <term>Windows 2000 or later</term>
		///         <description>
		///             <para>
		///             If you send a message on a domain controller that is running Active Directory, 
		///             access is allowed or denied based on the access control list (ACL) for the securable 
		///             object. The default ACL permits only Domain Admins and Account Operators to send a network message. 
		///             </para>
		///             <para>
		///             On a member server or workstation, only Administrators and Server Operators can send a network message. 
		///             </para>
		///         </description>
		///     </item>
		/// </list>
		/// </para>
		/// <para>
		/// For more information see <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/security_requirements_for_the_network_management_functions.asp">Security Requirements for the Network Management Functions</a>.
		/// </para>
		/// </remarks>
		/// <returns>
		/// <para>
		/// If the function succeeds, the return value is zero.
		/// </para>
		/// </returns>
		[DllImport("netapi32.dll", SetLastError=true)] 
		protected static extern int NetMessageBufferSend(	   
			[MarshalAs(UnmanagedType.LPWStr)] string serverName,
			[MarshalAs(UnmanagedType.LPWStr)] string msgName,
			[MarshalAs(UnmanagedType.LPWStr)] string fromName,
			[MarshalAs(UnmanagedType.LPWStr)] string buffer,
			int bufferSize);

		#endregion
	}
}

#endif // !CLI_1_0
#endif // !SSCLI
#endif // !MONO
#endif // !NETCF

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲欧美激情| 亚洲成人精品一区| 国产精品国产三级国产aⅴ中文 | 奇米色777欧美一区二区| 男女男精品视频| 成人免费不卡视频| 欧美日韩精品免费| 精品成人一区二区三区| 成人欧美一区二区三区视频网页| 一区二区成人在线视频 | 亚洲欧美日韩国产综合在线| 亚洲综合免费观看高清完整版 | 精品一区二区在线看| 成人av资源下载| 欧美一卡2卡3卡4卡| 综合色中文字幕| 久久国产视频网| 在线观看亚洲专区| 精品国产一区二区在线观看| 亚洲视频一区二区在线| 美女尤物国产一区| 欧美在线影院一区二区| 2024国产精品| 日韩精品欧美成人高清一区二区| 国产福利一区在线观看| 欧美中文字幕一二三区视频| 国产精品理伦片| 国产一区二区三区在线观看精品| 欧美三级电影网| 国产精品久久夜| 国产美女在线精品| 精品精品国产高清a毛片牛牛| 亚洲蜜臀av乱码久久精品蜜桃| 国产一区啦啦啦在线观看| 欧美精品一二三四| 中文字幕电影一区| 国产一区二区三区| 精品欧美乱码久久久久久1区2区| 亚洲综合一二三区| 97成人超碰视| 国产精品精品国产色婷婷| 九九热在线视频观看这里只有精品| 91黄色免费看| 最新不卡av在线| 日韩欧美国产一区二区三区| 亚洲成人动漫在线观看| 欧美精选午夜久久久乱码6080| 午夜精品福利视频网站| 日韩三区在线观看| 丰满白嫩尤物一区二区| 国产精品久久久久影院老司| 91国产成人在线| 麻豆免费精品视频| 国产偷国产偷亚洲高清人白洁| 成人一区二区三区中文字幕| 亚洲人成在线观看一区二区| 欧美群妇大交群的观看方式| 裸体在线国模精品偷拍| 精品成人a区在线观看| 国产成人午夜精品影院观看视频| 国产精品久久久久久久岛一牛影视 | 一本久久综合亚洲鲁鲁五月天| 亚洲色图制服诱惑| 欧美肥妇free| 国产激情91久久精品导航| 亚洲精品乱码久久久久久| 91精品国产综合久久福利软件| 国产一区视频网站| 一区二区欧美国产| 久久色成人在线| 91高清视频免费看| 国产91精品一区二区| 亚洲国产精品一区二区久久恐怖片 | 99精品欧美一区| 蜜臀av国产精品久久久久| 国产精品第四页| 欧美日韩午夜精品| 成人激情开心网| 日韩制服丝袜av| 亚洲欧洲一区二区三区| 在线电影国产精品| 一本大道久久a久久综合婷婷| 天天影视涩香欲综合网| 中文字幕中文乱码欧美一区二区| 欧美日韩三级一区| gogo大胆日本视频一区| 亚洲国产日韩在线一区模特| 国产精品久久看| 欧美成人a视频| 欧美日韩三级视频| 91在线高清观看| 国产成人免费视| 日韩黄色片在线观看| 亚洲蜜桃精久久久久久久| 久久亚洲一区二区三区四区| 欧美人与性动xxxx| 欧美在线你懂得| 91丝袜国产在线播放| 国产精品综合视频| 韩国v欧美v日本v亚洲v| 日韩国产精品91| 一区二区三区日韩在线观看| 国产精品色婷婷| 久久久.com| 2023国产精品视频| 精品免费国产一区二区三区四区| 欧美日本一区二区在线观看| 欧美亚洲尤物久久| 欧美日韩一区二区在线观看视频| proumb性欧美在线观看| 成人av影院在线| 成人美女视频在线观看18| 国产一区二区三区四| 久久机这里只有精品| 久久精品99久久久| 精品一区二区三区欧美| 精品中文av资源站在线观看| 美国十次了思思久久精品导航| 视频一区在线视频| 日韩激情中文字幕| 久久av老司机精品网站导航| 美国毛片一区二区三区| 国产一区二区久久| 国产99精品在线观看| www.亚洲激情.com| 色婷婷精品大在线视频| 欧美午夜一区二区三区免费大片| 色香色香欲天天天影视综合网| 91麻豆免费观看| 欧美少妇一区二区| 91精品国产综合久久婷婷香蕉| 91精品视频网| 精品国产精品网麻豆系列| 久久亚洲综合色一区二区三区| 国产三级精品三级在线专区| 最新国产の精品合集bt伙计| 夜夜亚洲天天久久| 免费精品视频在线| 国产裸体歌舞团一区二区| 成人精品视频一区二区三区| 91蜜桃网址入口| 欧美一区永久视频免费观看| 久久久久久97三级| 一区二区三区不卡视频| 久久成人免费网| 成人av电影在线| 欧美日韩国产综合一区二区三区| 日韩亚洲欧美高清| 国产精品乱人伦| 亚洲国产一区二区a毛片| 精品一区二区在线免费观看| 成人av午夜影院| 欧美日韩电影在线| 国产精品午夜在线| 日韩电影一二三区| 成人av网站在线| 91精品国产一区二区| 综合久久国产九一剧情麻豆| 午夜亚洲国产au精品一区二区| 国产精品夜夜嗨| 欧美日韩精品是欧美日韩精品| 久久免费精品国产久精品久久久久| 日韩美女视频一区二区| 蜜桃一区二区三区四区| 色先锋aa成人| 国产婷婷色一区二区三区在线| 亚洲不卡av一区二区三区| 粉嫩久久99精品久久久久久夜| 欧美巨大另类极品videosbest | 日韩中文字幕1| 91在线观看高清| 久久久久国产精品麻豆| 日本在线不卡一区| 91久久精品一区二区三| 久久精品欧美一区二区三区麻豆| 亚洲国产欧美另类丝袜| 成人黄色大片在线观看| 日韩精品一区二区三区视频在线观看| 亚洲欧洲国产专区| 国产精品一区二区x88av| 欧美欧美欧美欧美| 亚洲一区二区三区自拍| 99热国产精品| 国产精品素人视频| 国产成人免费视频网站高清观看视频 | 国产福利一区在线| 欧美刺激脚交jootjob| 五月天一区二区三区| 欧美中文字幕亚洲一区二区va在线| 国产精品亲子伦对白| 国产一区二区伦理| 久久―日本道色综合久久| 美女网站色91| 日韩一级大片在线| 热久久国产精品| 欧美日韩三级在线| 日韩精彩视频在线观看| 欧美一区午夜精品| 久久精品二区亚洲w码| 欧美精品一区二|