⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 istatlogger.cs

📁 精通网络应用系统开发 光盘 该书是人民邮电出版社出版的
💻 CS
字号:
using System;
using webvisitStatistic;
using webvisitStatistic.Reporter.IPLook;
namespace webvisitStatistic.HitsHandler.DBLayer
{
	/// <summary>
	/// IStatLogger 的摘要说明。
	/// </summary>
	interface IStatLogger : IDisposable
	{
		bool Init(String conn);
		void Log(StatInfo statInfo);

	}

	public abstract class StatLoggerBaseImpl : IStatLogger
	{

		protected String IPFormat(String inIp)
		{
			char[] delimStr = {'.'};
			String[] segs = inIp.Split(delimStr);
			return String.Format("{0,3}.{1,3}.{2,3}.{3,3}" ,segs[0] ,segs[1] ,segs[2] ,segs[3] );
		}

		protected String FormatRefUrl(String oref)
		{
			throw new NotImplementedException();
		}

		protected Int64 ParseIP(String inIp)
		{
			char[] delimStr = {'.'};
			String[] segs = inIp.Split(delimStr);
			Int64 ip1 = Int64.Parse(segs[0]);
			Int64 ip2 = Int64.Parse(segs[1]);
			Int64 ip3 = Int64.Parse(segs[2]);
			Int64 ip4 = Int64.Parse(segs[3]);

			return (ip1<<24) + (ip2<<16)	+ (ip3<<8) + ip4;
			
		}


		#region IStatLogger 成员

		public abstract bool Init(String conn);

		public abstract void Log(StatInfo statInfo);

		#endregion

		#region IDisposable 成员

		public void Dispose()
		{
			return;
		}
	
		#endregion

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -