»ñÈ¡ÕæʵIPºÍ´úÀíIP (asp.net C#)
³ÌÐò´úÂë
public static string GetRealIP()
{
string ip;
try
{
HttpRequest request = HttpContext.Current.Request;
if (request.ServerVariables["HTTP_VIA"] != null)
{
ip = request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString().Split(',')[0].Trim();
}
else
{
ip = request.UserHostAddress;
}
}
catch (Exception e)
{
throw e;
}
return ip;
}
»ñÈ¡´úÀíIP
³ÌÐò´úÂë
public static string GetViaIP()
{
string viaIp = null;
try
{
HttpRequest request = HttpContext.Current.Request;
if (request.ServerVariables["HTTP_VIA"] != null)
{
viaIp = request.UserHostAddress;
}
}
catch (Exception e)
{
throw e;
}
return viaIp;
}
Ïà¹ØÎĵµ£º
ÕâÊÇÒ»¸öÓйطÖÒ³µÄʵÀý,½ö¹©²Î¿¼(´úÂëÀ´×ÔÍøÂç)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;
using System.Threading;
using System.Collections;
us ......
¸ßЧʹÓÃʹÓÃSQL»º´æÒÀÀµ
ASP.NET FrameworkÐÂÔöµÄÒ»¸ö·Ç³£Ç¿´óµÄ¹¦ÄÜÊÇSQL»º´æÒÀÀµ¡£¸Ã¹¦ÄÜÔÊÐíµ×²ãÊý¾Ý¿âÖеÄÊý¾ÝÐÞ¸Äʱ£¬×Ô¶¯µØÖØÐÂÔØÈ뻺´æµÄÊý¾Ý¡£
ÔÚʹÓþø¶Ô»º´æ¹ýÆÚ²ßÂÔ»òÕßµ¯ÐÔ»º´æ¹ýÆÚ²ßÂÔʱÓÐÒ»¸öȨºâ£¬¶ÔÓÚÐÔÄܺͳ¾ÉÊý¾ÝµÄȨºâ¡£ÀýÈ磬Èç¹ûÔÚÄÚ´æÖлº´æÊý¾Ý20Ã룬ÔòÕâ20ÃëÄÚÏÔʾµÄÊý¾Ý¿ÉÄÜÊǹ ......
´Ë´¦ÌṩµÄ´úÂëÓÃÀ´ÊµÏÖµ±asp.netÒ³ÃæÖеÄij¸öButton±»µã»÷ºódisableµô¸ÃÒ³ÃæÖÐËùÓеÄButton£¬´Ó¶ø·ÀÖ¹Ìá½»ÑÓʱµ¼ÖµĶà´ÎÌá½»¡£»ùÓÚ֮ǰµÄonceclickbutton½Å±¾.
//ASP.NETÖзÀÖ¹Ò³Ãæ¶à´ÎÌá½»µÄ´úÂë:javascript< script language="javascript"> < !-- function disableOtherSubmit() {
var obj = event.srcElem ......
ASP.NET C# Éú³É¾²Ì¬Ò³Ãæ¼òµ¥·½·¨
//Ô´ÂëÊÇÌæ»»µôÄ£°åÖеÄÌØÕ÷×Ö·û
string mbPath = Server.MapPath("template.html");
Encoding cod ......