ASP.NET»ñÈ¡¿Í»§¶ËIP/Óû§ÃûµÈÐÅÏ¢
1. ÔÚASP.NETÖÐרÓÃÊôÐÔ£º
»ñÈ¡·þÎñÆ÷µçÄÔÃû£ºPage.Server.ManchineName
»ñÈ¡Óû§ÐÅÏ¢£ºPage.User
»ñÈ¡¿Í»§¶ËµçÄÔÃû£ºPage.Request.UserHostName
»ñÈ¡¿Í»§¶ËµçÄÔIP£ºPage.Request.UserHostAddress
2. ÔÚÍøÂç±à³ÌÖеÄͨÓ÷½·¨£º
»ñÈ¡µ±Ç°µçÄÔÃû£ºstatic System.Net.Dns.GetHostName()
¸ù¾ÝµçÄÔÃûÈ¡³öÈ«²¿IPµØÖ·£ºstatic System.Net.Dns.Resolve(µçÄÔÃû).AddressList
Ò²¿É¸ù¾ÝIPµØÖ·È¡³öµçÄÔÃû£ºstatic System.Net.Dns.Resolve(IPµØÖ·).HostName
3. ϵͳ»·¾³ÀàµÄͨÓÃÊôÐÔ£º
µ±Ç°µçÄÔÃû£ºstatic System.Environment.MachineName
µ±Ç°µçÄÔËùÊôÍøÓò£ºstatic System.Environment.UserDomainName
µ±Ç°µçÄÔÓû§£ºstatic System.Environment.UserName
4. if(Request.ServerVariables["HTTP_VIA"]!=null){ string user_IP=Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}else{
string user_IP=Request.ServerVariables["REMOTE_ADDR"].ToString();
}
5.<%=Request.UserHostAddress%>
6.»ñÈ¡¿Í»§¶ËIP:
private string GetClientIP()
{
string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (null == result || result == String.Empty)
{
result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
if (null == result || result == String.Empty)
{
result = HttpContext.Current.Request.UserHostAddress;
}
return result;
}
»ñÈ¡MACµØÖ·:
[DllImport("Iphlpapi.dll")]
private static extern int SendARP(Int32 dest,Int32 host,ref Int64 mac,ref Int32 length);
[DllImport("Ws2_32.dll")]
private static extern Int32 inet_addr(string ip);
private void Page_Load(object sender, System.EventArgs e)
{
// ÔÚ´Ë´¦·ÅÖÃÓû§´úÂëÒÔ³õʼ»¯Ò³Ãæ
try
{
Ïà¹ØÎĵµ£º
ASP.NET °²È«ÈÏÖ¤£¨Ò»£©—— ÈçºÎÔËÓà Form ±íµ¥ÈÏÖ¤
ASP.NET °²È«ÈÏÖ¤£¨¶þ£©——Áé»îÔËÓà Form ±íµ¥ÈÏÖ¤ÖÐµÄ deny Óë allow ¼°±£»¤ .htm µÈÎļþ
ASP.NET °²È«ÈÏÖ¤£¨Èý£© ——ÓÃForm ±íµ¥ÈÏ֤ʵÏÖµ¥µãµÇ¼£¨Single Sign On£©
ASP.NET °²È«ÈÏÖ¤£¨ËÄ£©Form ÈÏÖ¤µÄ²¹³ä ......
HttpApplication¶ÔÏó
HttpApplicationÊÇÒ»¸ö»ùÀ࣬´ú±íÔËÐÐÖеÄASP.NETÓ¦ÓóÌÐò¡£ÔËÐÐÖеÄASP.NETÓ¦ÓóÌÐòÓɶ¯Ì¬´´½¨µÄ¼Ì³ÐÓÚHttpApplicationµÄÀàÀ´±íʾ¡£Èç¹ûglobal.asax´æÔÚ£¬ÄÇôͨ¹ý½âÎöÆäÄÚÈÝ£¬¿ÉÒÔ´´½¨¶¯Ì¬Éú³ÉµÄÓ¦ÓóÌÐòÀàµÄÔ´´úÂë¡£Èç¹ûglobal.asax¿ÉÓã¬Ó¦ÓóÌÐòÀà±ã»á±»´´½¨£¬²¢¸ù¾ÝËüÃüÃûΪASP.global_asax¡£· ......
using System;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
namespace UserControl.UI
{
/// <summary>
/// TreesTable µÄժҪ˵Ã÷¡£
/// </summary>
public class TreesTable
{
public interface iTrees ......
ÓÃasp.net²Ù×÷excelµÄʵÏÖ´úÂ룬һֱ¶¼ÊDZ¾ÈËËùϲ»¶µÄ£¬´ÓÍøÉÏËÑÁËÏÂASP.NET ExcelÕÒµ½ÁËÕâÆªºÃÎÄÕÂ
Ïêϸ³ö´¦²Î¿¼£ºhttp://www.jb51.net/article/13629.htm
ExcelÊÇMicrosoft¹«Ë¾µÄOfficeÌ×¼þÖеÄÒ»ÖÖÈí¼þ£¬ËûÖ÷ÒªÓÃÀ´´¦Àíµç×Ó±í¸ñ¡£ExcelÒÔ½çÃæÓѺᢴ¦ÀíÊý¾ÝѸËÙµÈÓŵã»ñµÃ¹ã´ó°ì¹«ÈËÔ±µÄ»¶Ó¡£ËùÒԺܶàÎĵµ¾ÍÒÔExcelµÄ ......
×÷Ϊһ¸ö³ÌÐòÔ±£¬ÔÚÍê³ÉÉè¼Æºó»¹Òª¸ù¾Ý³ÌÐòµÄÇé¿öÒÔ¼°Óû§µÄ·´Ó³²»¶Ï¶Ô³ÌÐò½øÐиĽø£¬ÕâÑù²ÅÄܲ»¶ÏµØÍêÉÆ×Ô¼ºµÄ×÷Æ·¡£±ÊÕßÔÚÖÆ×÷ÍêÈí¼þÉÌÎñÍøµÄÂÛ̳ºó£¬·¢ÏÖÈËÃÇ×Üϲ»¶ÔÚÌû×ÓÖмÓÉϸ÷ÖÖÓÐÓõÄURLÁ´½Ó»òEmailµØÖ·¡£¶ø±ÊÕßµ±³õÉè¼ÆÊ±Ã»Óп¼Âǵ½ÕâÒ»µã£¬Ê¹µÃÕâЩURLÁ´½Ó»òEmailµØÖ·Ö»ÄÜÒÔÎÄ×ÖµÄÐÎʽ¶ø²¢²»ÊÇÒÔ³¬Á´½ÓµÄÐÎʽÏÔʾ ......