Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,
??
<embed? src=”pic/focus2.swf” wmode=”opaque” flashvars=”pics=pic/1.jpg|pic/B.jpg|pic/D.jpg|pic/t.jpg|pic/E.jpg&amp;links=gsdt_sj01.html|cpzs_sj.html|cpzs_sj2.html|cpzs_sj3.html|cpzs_sj4.html&amp;borderwidth=880&amp;borderheight=260&amp;texts=工厂收购|B款|D款|T款|E款&amp;textheight=50″ menu=”false” bgcolor=”#CCCCCC” quality=”high” allowscriptaccess=”sameDomain” type=”application/x-shockwave-flash” pluginspage=”http://www.macromedia.com/go/getflashplayer” width=”880″ height=”252″></embed>

注:Firefox不支持object classid, 故要用embed,focus2.swf见Gmail

pics :指定显示的图片
links:每张图片对应的连接
texts:在图片下方显示的文字。
&amp;? 就是&
在links中若想url带参,用%26,而不是&,也不是&amp;
?? ?flash中会将“&”符号当分隔符处理,这样URL地址就变得不完整了,解决方法是将URL中的“&”改成“%26”即可。

<object ….. >

? <param …/>

</object>这种,在firefox中显示不出来,

可以用:

<object …..>

? <embed …/>

</object>

因为<embed src=””/>本身就是flash标签,所有想要同时支持ie和firefox,直接用<embed src=””/>

<embed name=”movie” src=”flash?参数” width=”” height=”” bgcolor=”” menu=”false” wmode=”opaque” />


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
 




无标题文档











Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
 1,select:
        

2, js



Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
1,     
     
   



2,package com.tianren.service;
import java.net.*;

import sun.security.krb5.internal.HostAddress;

public class Test{
 InetAddress myIPaddress = null;
 InetAddress myServer = null;
 String hostAddress = null;
 String hostName = null;
 String Address = null ;
 String Name = null ;
 public static void main(String args[]) {

  Test mytool;
  mytool = new Test();
  mytool.getAllServerIP();
//  System.out.println("Your host IP is: " + mytool.getMyIP());
//  System.out.println("The Server IP is :" + mytool.getServerIP());
  
  
  
 }

 // 取得LOCALHOST的IP地址
 public String getMyIP() {
  try {
   myIPaddress = InetAddress.getLocalHost();
   hostAddress = myIPaddress.getHostAddress();//仅仅获得IP地址
   hostName = myIPaddress.getHostName();//获得本地名称
  } catch (UnknownHostException e) {
  }
  return (hostName);
 }

 // 取得 www.abc.com 的IP地址
 public String getServerIP() {
  try {
   myServer = InetAddress.getByName("www.abc.com");
   Address = myServer.getHostAddress();//获得www.abc.com的ip地址
   Name = myServer.getHostName();//获得域名
  } catch (UnknownHostException e) {
  }
  return (Name);
 }
 //获取此域名下的所有IP
 public void getAllServerIP(){
  String name = "www.microsoft.com";
  try{
   
   InetAddress[] addresses= InetAddress.getAllByName(name);
   for(int i =0;i
								


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

function chek( chkAll )
??? {
??????? var obj = document.aspnetForm.getElementsByTagName(“input”);
?? ??? ??? ?
?? ??? ??? ?for (var i=0;i<obj.length;i++)
?? ??? ??? ?{
?? ??? ??? ?
?? ??? ??? ??? ?var e = obj[i];
?? ??? ??? ??? ?if (e.id.indexOf(“chkItem”)>=0 && e.type==”checkbox”)
?? ??? ??? ??? ??? ?e.checked = chkAll.checked;
?? ??? ??? ?}
?? ??? ??? ?
??? }

头部:
? <input type=”checkbox” id=”chkAll” onclick=”CheckAll( this );” />

子项:
<asp:CheckBox ID=”chkItem” runat=”server” />


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

都有一个onclick事件,当结果返回true时才会执行
“>删除

< input type = "submit" ID="Button1" Text="提交" onsubmit ="return confirm('Ok to post?')" />


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
this.oBtnTodayTitle="Today"
this.oBtnCancelTitle="Cancel"
this.weekDaySting=new Array("S","M","T","W","T","F","S");
this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
this.Width=200;
this.currDate=new Date();
this.today=new Date();
this.startYear=1970;
this.endYear=2010;
///Css
this.normalfontColor="#666666";
this.selectedfontColor="red";
this.divBorderCss="1px solid #BCD0DE";
this.titleTableBgColor="#98B8CD";
this.tableBorderColor="#CCCCCC"
///Method
this.Init=CalendarInit;
this.Fill=CalendarFill;
this.Refresh=CalendarRefresh;
this.Restore=CalendarRestore;
///HTMLObject
this.oTaget=null;
this.oPreviousCell=null;
this.sDIVID=InstanceName+"_Div";
this.sTABLEID=InstanceName+"_Table";
this.sMONTHID=InstanceName+"_Month";
this.sYEARID=InstanceName+"_Year";
this.sTODAYBTNID=InstanceName+"_TODAYBTN";
}
function CalendarInit() ///Create panel
{
var sMonth,sYear
sMonth=this.currDate.getMonth();
sYear=this.currDate.getYear();
htmlAll="";
document.write(htmlAll);
this.Fill(); 
}
function CalendarFill() ///
{
var sMonth,sYear,sWeekDay,sToday,oTable,currRow,MaxDay,iDaySn,sIndex,rowIndex,cellIndex,oSelectMonth,oSelectYear
sMonth=this.currDate.getMonth();
sYear=this.currDate.getYear();
sWeekDay=(new Date(sYear,sMonth,1)).getDay();
sToday=this.currDate.getDate();
iDaySn=1
oTable=document.all[this.sTABLEID];
currRow=oTable.rows[1];
MaxDay=CalendarGetMaxDay(sYear,sMonth);
oSelectMonth=document.all[this.sMONTHID]
oSelectMonth.selectedIndex=sMonth;
oSelectYear=document.all[this.sYEARID]
for(i=0;iMaxDay)break;
currRow = oTable.rows[rowIndex];
cellIndex = 0;
if(rowIndex==1)cellIndex = sWeekDay;
for(;cellIndex"+iDaySn+"";
this.oPreviousCell=currRow.cells[cellIndex];
}
else
{
currRow.cells[cellIndex].innerHTML=iDaySn; 
currRow.cells[cellIndex].style.color=this.normalfontColor;
}
CalendarCellSetCss(0,currRow.cells[cellIndex]);
iDaySn++;
if(iDaySn>MaxDay)break; 
}
}
}
function CalendarRestore() /// Clear Data
{ 
var i,j,oTable
oTable=document.all[this.sTABLEID]
for(i=1;i11)
{
nextYear=nowYear+1;
nextMonth=0;
}
else 
{
nextYear=nowYear; 
}
currDate=new Date(nowYear,nowMonth,1);
nextDate=new Date(nextYear,nextMonth,1);
theMaxDay=(nextDate-currDate)/(24*60*60*1000);
return theMaxDay;
}
function CalendargetPos(el,ePro) /// Get Absolute Position
{
var ePos=0;
while(el!=null)
{ 
ePos+=el["offset"+ePro];
el=el.offsetParent;
}
return ePos;
}
function CalendarDblNum(num)
{
if(num < 10) 
return "0"+num;
else
return num;
}
function CalendarCancel(oInstance) ///Cancel
{
var CalendarDiv=document.all[oInstance.sDIVID];
CalendarDiv.style.display="none"; 
}


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

调用方法:

<HTML>
<HEAD>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<meta http-equiv=”Content-Language” content=”zh-cn”>
<TITLE></TITLE>
<script language=”javascript” src=”calendar.js” ></script>
</head>
<BODY >
<script >
var oCalendarEn=new PopupCalendar(“oCalendarEn”);??? //初始化控件时,请给出实例名称如:oCalendarEn
oCalendarEn.Init();
?
var oCalendarChs=new PopupCalendar(“oCalendarChs”);??? //初始化控件时,请给出实例名称:oCalendarChs
oCalendarChs.weekDaySting=new Array(“日”,”一”,”二”,”三”,”四”,”五”,”六”);
oCalendarChs.monthSting=new Array(“一月”,”二月”,”三月”,”四月”,”五月”,”六月”,”七月”,”八月”,”九月”,”十月”,”十一月”,”十二月”);
oCalendarChs.oBtnTodayTitle=”今天”;
oCalendarChs.oBtnCancelTitle=”取消”;
oCalendarChs.Init();
</script>
<br><br><br><br>
   <input readonly type=”text” name=”dd” id=”aa” onclick=”getDateString(this,oCalendarEn)” value=”English Version”>
<br><br><br><br>
   <input readonly type=”text” name=”dd” id=”aa” onclick=”getDateString(this,oCalendarChs)” value=”中文界面版”>??????????????????????????????????
</BODY>
</HTML>


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58



Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

Response输出指定内容,去掉页面自带的内容

//下面的方法,无论当前页面是什么内容,都只输出自己指定的数据。
Response.Clear(); //清除页面前的内容
Response.Write(“hahahahahahahahahhahahahahahahahhahahahaha”); //指定的内容
Response.End(); //之后的内容不再输出


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
   抓取IP

    REMOTE_ADDR:访问网站的最新的一个IP地址
    HTTP_X_FORWARDED_FOR:中转IP集合即 从出发点到网站前的IP集合,以逗号分开
    1,若直接访问网站,不经过代理,则REMOTE_ADDR为真实IP,HTTP_X_FORWARDED_FOR为空
    2,若使用代理访问网站,则REMOTE_ADDR为最后一个经过的代理IP地址,而HTTP_X_FORWARDED_FOR集合中第一个为真实IP
    由上得出抓取真实IP的方法为:
         private string GetIP()
        {
            if (Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
            {
                return Request.ServerVariables["HTTP_X_FORWARDED_FOR"].Split(new char[] { ',' })[0];
            }
            else
            {
                return Request.ServerVariables["REMOTE_ADDR"];
            }
        }

    注:REMOTE_ADDR此值是不可修改的,因为网站要与代理服务器通信,要给它传数据,若可修改,那么代理服务器就收不到数据了,因此若通过REMOTE_ADDR得到IP,那么此IP一定是真实的。
          HTTP_X_FORWARDED_FOR值是可以修改的,若通过此值取真实IP,有可能是篡改的非真实IP.不过,对于大访问量的网站来说,大部分的客户都是合法的,只有极少的一部分通过篡改IP的方式去访问,在此种情况下,可以适用上述方法得到IP
    不过对于网上投票那种,篡改IP的方式则很有空间,对于此种,就不能再通过IP去确定是不是同一人点击之类,可以写一个加密的cookie来识别。

    //篡改HTTP_X_FORWARDED_FOR
    static void Main(string[] args)
    {
    HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(
    "http://localhost:7867/MyTestWebSite/UserIP.aspx");
    request.Headers.Add("REMOTE_ADDR", "192.168.5.88");
    request.Headers.Add("VIA", "ghj1976");
    request.Headers.Add("X_FORWARDED_FOR", "0.0.0.0");
    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    StreamReader stream = new
    StreamReader(response.GetResponseStream());
    string info = stream.ReadToEnd();
    stream.Close();
    response.Close();
    request = null;
    Console.Write(info);
    Console.ReadLine();
    }



Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

1,工程都有一*.csproj,直接添加即可。
?2,对于网站,先用IIS指向此网站,然后在解决方案添加的时候 添加现有网站-本地IIS 找到网站,加上即可。


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

原理:在on blur 或 onkeydown 时显示调用 _doPoastBack事件,回访到服务器端,要执行对应的哪个方法,在前台加hidden指定
如: function btnClick( btn ){
??????????? if (? event.keyCode == 13 &&? btn != undefined ){
??????????????? //btn.click();
??????????????? document.getElementById(“myHidState”).value = btn.id;? //设置input type = ‘hidden’ 的值
??????????????? __doPostBack(btn.id,””);
??????????? }
??????? }
在后台 load时就可据 Request.Forms[“myHidStateName”] 的值要执行对应的方法


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

? <input type=”text” id = “Text1″ name=”myText111” />
在后台用:Request.Form[“myText111”] 调用前台的值

遍历页面传来的所有值
int loop1;
NameValueCollection coll=Request.Form;?
string[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{ Response.Write(“Form: ” + arr1[loop1] + “<br>”); }


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

?

?<input?type=”hidden”?name=”__EVENTTARGET”?id=”__EVENTTARGET”?value=””?/> <input?type=”hidden”?name=”__EVENTARGUMENT”?id=”__EVENTARGUMENT”?value=””?/> function?__doPostBack(eventTarget,?eventArgument)?{ if?(!theForm.onsubmit?||?(theForm.onsubmit()?!=?false))?{ theForm.__EVENTTARGET.value?=?eventTarget; theForm.__EVENTARGUMENT.value?=?eventArgument; theForm.submit(); } }

1,eventTarget? 代表控件ID, eventArgument代表控件对应的数据 可用: Request.Form[“__EVENTTARGET”] 形式获取ID,参数。特别在用CheckBoxList时,在其OnSelectedIndexChanged事件中可通过如下方式获取点击的CheckBox:
?? ? string ClickedItem = Request.Form[“__EVENTTARGET”];//得到用户点击的是哪个
????? ClickedItem = ClickedItem.Split(‘$’)[1];//进行拆分处理
???? chkDepartlist.Items[StringHelper.FormatBlankStringToint(ClickedItem)].Value) //当前点击的CheckBox

2, Button与ImageButton不可通过上述方式得到ID,因为他们没有调用 _doPostBack 方法,是直接submit的方式
?? 不过可用如下方式替换:
?? ???? <input?type=”button”?id=”Button2″?value=”Press?me”?onclick=”DoPostBack()”?/>?? <!–显示调用–>
??? ??? ?<script?language=”javascript”?type=”text/javascript”> ?
?? ??? ??? ??? ?function?DoPostBack()? { ??__doPostBack(‘Button2′,’My?Argument’);????? } ?
?? ??? ??? ?</script> string?passedArgument?=?Request.Params.Get(“__EVENTARGUMENT”);


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

维护着Application这个类,指示着在程序启动关闭、session启动关闭可做的事情。
如:Application_Start 、Session_Start


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

int i = (int)Keys.F1; //112
MessageBox.Show(Enum.GetName(typeof(Keys), i)); //F1


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58
public static string GetValue(string AppKey)
        {
            try
            {
                string AppKeyValue;
                AppKeyValue = System.Configuration.ConfigurationSettings.AppSettings.Get(AppKey);
                return AppKeyValue;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static void SetValue(string AppKey, string AppValue)
        {
            //System.Configuration.ConfigurationSettings.AppSettings.Set(AppKey,AppValue);
            XmlDocument xDoc = new XmlDocument();
            xDoc.Load(System.Windows.Forms.Application.ExecutablePath + ".config");

            XmlNode xNode;
            XmlElement xElem1;
            XmlElement xElem2;
            xNode = xDoc.SelectSingleNode("//appSettings");

            xElem1 = (XmlElement)xNode.SelectSingleNode("//add[@key='" + AppKey + "']");
            if (xElem1 != null) xElem1.SetAttribute("value", AppValue);
            else
            {
                xElem2 = xDoc.CreateElement("add");
                xElem2.SetAttribute("key", AppKey);
                xElem2.SetAttribute("value", AppValue);
                xNode.AppendChild(xElem2);
            }
            xDoc.Save(System.Windows.Forms.Application.ExecutablePath + ".config");
        }


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

?1,<asp:button ? id=”x” ? runat=”server” ? OnClientClick=”this.disabled=true;document.post.submit();” ? /> ?
? ?
?? 2,设置一全局JS变量
var hasSubmit = 0;
。。。。{
?? ? if ( hasSubmit == 0 ){
??????????????? hasSubmit = 1;
??????????????? return true;
??????????? }else{
??????????????? return false;
??????????? }
}