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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? nativeerror.cs

?? 詳細(xì)講述了數(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 has no support for Win32 Error APIs
#if !MONO
// SSCLI 1.0 has no support for Win32 Error APIs
#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;

namespace log4net.Util 
{
	/// <summary>
	/// Represents a native error code and message.
	/// </summary>
	/// <remarks>
	/// <para>
	/// Represents a Win32 platform native error.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	/// <author>Gert Driesen</author>
	public sealed class NativeError 
	{
		#region Protected Instance Constructors

		/// <summary>
		/// Create an instance of the <see cref="NativeError" /> class with the specified 
		/// error number and message.
		/// </summary>
		/// <param name="number">The number of the native error.</param>
		/// <param name="message">The message of the native error.</param>
		/// <remarks>
		/// <para>
		/// Create an instance of the <see cref="NativeError" /> class with the specified 
		/// error number and message.
		/// </para>
		/// </remarks>
		private NativeError(int number, string message) 
		{
			m_number = number;
			m_message = message;
		}

		#endregion // Protected Instance Constructors

		#region Public Instance Properties

		/// <summary>
		/// Gets the number of the native error.
		/// </summary>
		/// <value>
		/// The number of the native error.
		/// </value>
		/// <remarks>
		/// <para>
		/// Gets the number of the native error.
		/// </para>
		/// </remarks>
		public int Number 
		{
			get { return m_number; }
		}

		/// <summary>
		/// Gets the message of the native error.
		/// </summary>
		/// <value>
		/// The message of the native error.
		/// </value>
		/// <remarks>
		/// <para>
		/// </para>
		/// Gets the message of the native error.
		/// </remarks>
		public string Message 
		{
			get { return m_message; }
		}

		#endregion // Public Instance Properties

		#region Public Static Methods

		/// <summary>
		/// Create a new instance of the <see cref="NativeError" /> class for the last Windows error.
		/// </summary>
		/// <returns>
		/// An instance of the <see cref="NativeError" /> class for the last windows error.
		/// </returns>
		/// <remarks>
		/// <para>
		/// The message for the <see cref="Marshal.GetLastWin32Error"/> error number is lookup up using the 
		/// native Win32 <c>FormatMessage</c> function.
		/// </para>
		/// </remarks>
		public static NativeError GetLastError() 
		{
			int number = Marshal.GetLastWin32Error();
			return new NativeError(number, NativeError.GetErrorMessage(number));
		}

		/// <summary>
		/// Create a new instance of the <see cref="NativeError" /> class.
		/// </summary>
		/// <param name="number">the error number for the native error</param>
		/// <returns>
		/// An instance of the <see cref="NativeError" /> class for the specified 
		/// error number.
		/// </returns>
		/// <remarks>
		/// <para>
		/// The message for the specified error number is lookup up using the 
		/// native Win32 <c>FormatMessage</c> function.
		/// </para>
		/// </remarks>
		public static NativeError GetError(int number) 
		{
			return new NativeError(number, NativeError.GetErrorMessage(number));
		}

		/// <summary>
		/// Retrieves the message corresponding with a Win32 message identifier.
		/// </summary>
		/// <param name="messageId">Message identifier for the requested message.</param>
		/// <returns>
		/// The message corresponding with the specified message identifier.
		/// </returns>
		/// <remarks>
		/// <para>
		/// The message will be searched for in system message-table resource(s)
		/// using the native <c>FormatMessage</c> function.
		/// </para>
		/// </remarks>
		public static string GetErrorMessage(int messageId) 
		{
			// Win32 constants
			int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100;	// The function should allocates a buffer large enough to hold the formatted message
			int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200;		// Insert sequences in the message definition are to be ignored
			int FORMAT_MESSAGE_FROM_SYSTEM  = 0x00001000;		// The function should search the system message-table resource(s) for the requested message

			string msgBuf = "";				// buffer that will receive the message
			IntPtr sourcePtr = new IntPtr();	// Location of the message definition, will be ignored
			IntPtr argumentsPtr = new IntPtr();	// Pointer to array of values to insert, not supported as it requires unsafe code

			if (messageId != 0) 
			{
				// If the function succeeds, the return value is the number of TCHARs stored in the output buffer, excluding the terminating null character
				int messageSize = FormatMessage(
					FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, 
					ref sourcePtr, 
					messageId, 
					0, 
					ref msgBuf, 
					255, 
					argumentsPtr);

				if (messageSize > 0) 
				{
					// Remove trailing null-terminating characters (\r\n) from the message
					msgBuf = msgBuf.TrimEnd(new char[] {'\r', '\n'});
				}
				else 
				{
					// A message could not be located.
					msgBuf = null;
				}
			} 
			else 
			{
				msgBuf = null;
			}

			return msgBuf;
		}

		#endregion // Public Static Methods

		#region Override Object Implementation

		/// <summary>
		/// Return error information string
		/// </summary>
		/// <returns>error information string</returns>
		/// <remarks>
		/// <para>
		/// Return error information string
		/// </para>
		/// </remarks>
		public override string ToString() 
		{
			return string.Format(CultureInfo.InvariantCulture, "0x{0:x8}", this.Number) + (this.Message != null ? ": " + this.Message : "");
		}

		#endregion // Override Object Implementation

		#region Stubs For Native Function Calls

		/// <summary>
		/// Formats a message string.
		/// </summary>
		/// <param name="dwFlags">Formatting options, and how to interpret the <paramref name="lpSource" /> parameter.</param>
		/// <param name="lpSource">Location of the message definition.</param>
		/// <param name="dwMessageId">Message identifier for the requested message.</param>
		/// <param name="dwLanguageId">Language identifier for the requested message.</param>
		/// <param name="lpBuffer">If <paramref name="dwFlags" /> includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the <c>LocalAlloc</c> function, and places the pointer to the buffer at the address specified in <paramref name="lpBuffer" />.</param>
		/// <param name="nSize">If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer.</param>
		/// <param name="Arguments">Pointer to an array of values that are used as insert values in the formatted message.</param>
		/// <remarks>
		/// <para>
		/// The function requires a message definition as input. The message definition can come from a 
		/// buffer passed into the function. It can come from a message table resource in an 
		/// already-loaded module. Or the caller can ask the function to search the system's message 
		/// table resource(s) for the message definition. The function finds the message definition 
		/// in a message table resource based on a message identifier and a language identifier. 
		/// The function copies the formatted message text to an output buffer, processing any embedded 
		/// insert sequences if requested.
		/// </para>
		/// <para>
		/// To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message.
		/// </para>
		/// </remarks>
		/// <returns>
		/// <para>
		/// If the function succeeds, the return value is the number of TCHARs stored in the output 
		/// buffer, excluding the terminating null character.
		/// </para>
		/// <para>
		/// If the function fails, the return value is zero. To get extended error information, 
		/// call <see cref="Marshal.GetLastWin32Error()" />.
		/// </para>
		/// </returns>
#if NETCF
		[DllImport("CoreDll.dll", SetLastError=true, CharSet=CharSet.Unicode)]
#else
		[DllImport("Kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]
#endif
		private static extern int FormatMessage(
			int dwFlags, 
			ref IntPtr lpSource, 
			int dwMessageId,
			int dwLanguageId, 
			ref String lpBuffer, 
			int nSize,
			IntPtr Arguments);

		#endregion // Stubs For Native Function Calls

		#region Private Instance Fields

		private int m_number;
		private string m_message;

		#endregion
	}
}

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人激情文学综合网| 五月激情综合色| 国产精品99久| 国产亚洲视频系列| 国产福利91精品一区二区三区| 精品国产亚洲在线| 国产精品一线二线三线精华| 中文字幕欧美三区| 91猫先生在线| 偷拍日韩校园综合在线| 日韩精品中午字幕| 成人三级伦理片| 亚洲国产欧美在线| 精品理论电影在线| zzijzzij亚洲日本少妇熟睡| 亚洲伊人伊色伊影伊综合网 | 精品婷婷伊人一区三区三| 天堂va蜜桃一区二区三区漫画版| 欧美成人a视频| 成人小视频免费观看| 亚洲第一狼人社区| 久久免费电影网| 色婷婷综合久久久久中文一区二区| 亚洲一区二区三区免费视频| 精品久久久久久久久久久久包黑料| 本田岬高潮一区二区三区| 亚洲aaa精品| 国产日韩三级在线| 欧美男人的天堂一二区| 国产黄色精品网站| 亚洲日本在线观看| 久久久亚洲精品石原莉奈| 日本乱人伦aⅴ精品| 国产精品综合视频| 午夜视频在线观看一区二区三区| 国产亚洲成年网址在线观看| 欧美日产国产精品| 成人美女视频在线观看18| 日本欧美在线观看| 一区二区三区精品视频| 久久精品亚洲乱码伦伦中文| 欧美日韩一区不卡| 成人国产精品视频| 美女在线视频一区| 日韩高清国产一区在线| 国产精品女主播av| 精品成人私密视频| 欧美精选午夜久久久乱码6080| 成人福利视频网站| 久草热8精品视频在线观看| 亚洲一级二级三级| 成人免费视频在线观看| 久久久久久99久久久精品网站| 欧美酷刑日本凌虐凌虐| 91国偷自产一区二区三区观看| 国产精品一二三区在线| 美女在线视频一区| 免费成人你懂的| 午夜欧美一区二区三区在线播放| 国产精品成人午夜| 国产精品午夜在线观看| 久久精品夜夜夜夜久久| 欧美成人精品福利| 欧美变态凌虐bdsm| 欧美一级专区免费大片| 3d动漫精品啪啪| 欧美一区二区三区在线| 在线电影院国产精品| 777a∨成人精品桃花网| 欧美高清视频不卡网| 欧美精品精品一区| 欧美在线高清视频| 欧美日韩视频在线一区二区| 欧美午夜免费电影| 6080亚洲精品一区二区| 欧美精三区欧美精三区| 欧美一级一区二区| 91精品久久久久久久久99蜜臂| 欧美一区二区免费| 日韩欧美一区二区三区在线| 精品国内片67194| 久久日韩粉嫩一区二区三区 | 国产一区在线精品| 人人爽香蕉精品| 在线观看亚洲专区| 欧美手机在线视频| 欧美日韩www| 精品奇米国产一区二区三区| 精品欧美乱码久久久久久| 2022国产精品视频| 中文字幕电影一区| 亚洲精品videosex极品| 亚洲国产精品一区二区久久| 日韩精品成人一区二区三区| 麻豆国产91在线播放| 国产69精品久久99不卡| 99久久国产综合精品麻豆| 欧美综合色免费| 日韩欧美黄色影院| 中文字幕免费一区| 亚洲精品成人少妇| 麻豆精品国产91久久久久久| 在线免费不卡视频| 在线播放一区二区三区| 欧美精品一区二区三区在线 | 午夜精品123| 蜜桃精品在线观看| 成人h精品动漫一区二区三区| 91麻豆福利精品推荐| 欧美三电影在线| 久久综合色播五月| 亚洲人成亚洲人成在线观看图片| 午夜国产不卡在线观看视频| 国产精品亚洲一区二区三区妖精| 91丨porny丨中文| 日韩午夜在线播放| 亚洲手机成人高清视频| 美女视频黄免费的久久| 99久久精品费精品国产一区二区| 欧美日韩综合在线免费观看| 久久久久国产免费免费| 亚洲成人www| 成人av片在线观看| 日韩视频在线你懂得| 亚洲欧美一区二区在线观看| 日本不卡一二三区黄网| 91在线免费播放| 欧美成人女星排名| 亚洲国产精品一区二区久久恐怖片| 国产99精品国产| 欧美一区二区久久久| 一区二区三区波多野结衣在线观看| 国产在线精品一区在线观看麻豆| 在线一区二区三区四区| 国产精品色哟哟| 老司机精品视频导航| 欧美性一二三区| 中文字幕在线一区| 国产一区二区不卡在线| 日韩一级片在线观看| 亚洲成a人v欧美综合天堂| 一本色道久久综合精品竹菊| 91精品国产色综合久久| 国产不卡在线一区| 免费一级片91| 成人欧美一区二区三区白人| 国产伦理精品不卡| 精品电影一区二区三区| 美腿丝袜亚洲综合| 欧美一卡2卡3卡4卡| 亚洲v中文字幕| 在线欧美日韩精品| 亚洲精品免费电影| 色婷婷亚洲综合| 亚洲欧美日韩国产中文在线| 成人丝袜18视频在线观看| 亚洲国产成人私人影院tom| 国产尤物一区二区在线| 亚洲精品在线一区二区| 久久er99热精品一区二区| 日韩欧美国产小视频| 美洲天堂一区二卡三卡四卡视频| 欧美一区国产二区| 免费观看日韩av| 精品欧美一区二区久久| 精品一区精品二区高清| 日韩欧美国产一区二区三区| 久久国产欧美日韩精品| 精品国精品国产尤物美女| 久久99久久久欧美国产| 精品国产伦一区二区三区免费 | 免费观看在线色综合| 欧美一区二区黄色| 色噜噜久久综合| 亚洲午夜精品在线| 91麻豆精品国产91久久久资源速度 | 色噜噜狠狠成人网p站| 一区二区视频在线| 在线亚洲欧美专区二区| 亚洲国产日韩综合久久精品| 欧美亚洲综合一区| 日日摸夜夜添夜夜添精品视频 | 午夜精品久久久久久久99水蜜桃| 欧美久久久久中文字幕| 久久99热狠狠色一区二区| 久久久久久久久一| 91在线视频观看| 性做久久久久久免费观看欧美| 51久久夜色精品国产麻豆| 国模一区二区三区白浆| 国产精品久久久久久久久免费樱桃| 色婷婷激情综合| 五月综合激情婷婷六月色窝| 精品国产乱码久久久久久牛牛| 国产成人精品免费网站| 亚洲美女屁股眼交| 日韩一区二区电影在线| 国产99精品国产| 亚洲不卡在线观看| 久久久99精品久久|