using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient;namespace IT_System_Links { public partial class _Default : System.Web.UI.Page {
他們還混什么?
類似搜索的:http://blog.sina.com.cn/s/blog_5ea9354f0100dbwv.html
需要用到MS Ajax控件下載地址:http://download.csdn.net/source/1117295
<html>
<head>
</head>
<body>
<SCRIPT language=javascript>
function gowhere1(formname)
{
var url;
if (formname.myselectvalue.value == "0")
{
url = "http://www.baidu.com/baidu";
document.search_form1.tn.value = "baidu";
formname.method = "get";
}
if (formname.myselectvalue.value == "1")
{
url = "http://mp3.baidu.com/m";
document.search_form1.tn.value = "baidump3";
document.search_form1.ct.value = "134217728";
document.search_form1.lm.value = "-1";
}if (formname.myselectvalue.value == "4")
{
document.search_form1.tn.value = "news";
document.search_form1.cl.value = "2";
document.search_form1.rn.value = "20";
url = "http://news.baidu.com/ns";
}
if (formname.myselectvalue.value == "5")
{
document.search_form1.tn.value = "baiduiamge";
document.search_form1.ct.value = "201326592";
document.search_form1.cl.value = "2";
document.search_form1.lm.value = "-1";
url = "http://image.baidu.com/i";
}
if (formname.myselectvalue.value == "6")
{
url = "http://post.baidu.com/f";
document.search_form1.tn.value = "baiduPostSearch";
document.search_form1.ct.value = "352321536";
document.search_form1.rn.value = "10";
document.search_form1.lm.value = "65536";
} formname.action = url;
return true;
}
</SCRIPT>
<form name="search_form1" target="_blank" onsubmit="return gowhere1(this)">
<table width="460" height="60" border="0" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" style=font-family:宋体><tr><td>
<TABLE width="460" height="80" border=0 cellPadding=0 cellSpacing=0>
<INPUT name=myselectvalue type=hidden value=0>
<INPUT name=tn type=hidden>
<INPUT name=ct type=hidden>
<INPUT name=lm type=hidden>
<INPUT name=cl type=hidden>
<INPUT name=rn type=hidden>
<TR>
<TD width="8%" valign="bottom">
<DIV align=center><a href="http://www.baidu.com/"><img src="http://img.baidu.com/img/logo-80px.gif"
alt="Baidu" align="bottom" border="0"></a></DIV></TD>
<TD vAlign=bottom width="92%">
<INPUT name=myselect onclick=javascript:this.form.myselectvalue.value=4; type=radio value=0>
<FONT color=#0000cc style="FONT-SIZE: 12px">新闻</FONT>
<INPUT CHECKED name=myselect onclick=javascript:this.form.myselectvalue.value=0; type=radio value=0>
<SPAN class=f12><FONT color=#0000cc style="FONT-SIZE: 12px">网页</FONT></SPAN>
<INPUT name=myselect onclick=javascript:this.form.myselectvalue.value=1; type=radio value=1>
<SPAN class=f12><FONT color=#0000cc style="FONT-SIZE: 12px">mp3</FONT></SPAN>
<INPUT name=myselect onclick=javascript:this.form.myselectvalue.value=6; type=radio value=0>
<FONT color=#0000cc style="FONT-SIZE: 12px">贴吧</FONT>
<INPUT name=myselect onclick=javascript:this.form.myselectvalue.value=5; type=radio value=0>
<FONT color=#0000cc style="FONT-SIZE: 12px">图片</FONT>
<TABLE align=right border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD><FONT style="FONT-SIZE: 12px">
<input id=word name=word size="40">
</FONT> <input type="submit" value="百度搜索"> </TD></TR>
</form>
</body>
</html>
Nutch , Lucene 这两个比较多。其余参考:http://www.open-open.com/32.htm
看这个行不行 仿google搜索无需ajax
他們還混什么?
我想要一个没有标志的 源码啊 谁个有啊
不知道是否符合你
<!--把下面代码加到<head>与</head>之间--><style style="text/css">body,div {
}input { width:300px;}h1 { text-align:center; font-size:2.2em;}#divc { border:1px solid #555;}.des { width:500px; background-color:lightyellow; border:1px solid #555; padding:25px; margin-top:25px;}.mouseover { color:#ffffff; background-color:highlight; width:100%; cursor:default;}.mouseout { color:#000; width:100%; background-color:#ffffff; cursor:default;}</style><script language="javascript"><!--function jsAuto(instanceName,objID){ this._msg = []; this._x = null; this._o = document.getElementById( objID ); if (!this._o) return; this._f = null; this._i = instanceName; this._r = null; this._c = 0; this._s = false; this._v = null; this._o.style.visibility = "hidden"; this._o.style.position = "absolute"; this._o.style.zIndex = "9999"; this._o.style.overflow = "auto"; this._o.style.height = "100"; return this;};jsAuto.prototype.directionKey=function() { with (this){ var e = _e.keyCode ? _e.keyCode : _e.which; var l = _o.childNodes.length; (_c>l-1 || _c<0) ? _s=false : ""; if( e==40 && _s ) { _o.childNodes[_c].className="mouseout"; (_c >= l-1) ? _c=0 : _c ++; _o.childNodes[_c].className="mouseover"; } if( e==38 && _s ) { _o.childNodes[_c].className="mouseout"; _c--<=0 ? _c = _o.childNodes.length-1 : ""; _o.childNodes[_c].className="mouseover"; } if( e==13 ) { if(_o.childNodes[_c] && _o.style.visibility=="visible") { _r.value = _x[_c]; _o.style.visibility = "hidden"; } } if( !_s ) { _c = 0; _o.childNodes[_c].className="mouseover"; _s = true; }}};// mouseEvent.jsAuto.prototype.domouseover=function(obj) { with (this){ _o.childNodes[_c].className = "mouseout"; _c = 0; obj.tagName=="DIV" ? obj.className="mouseover" : obj.parentElement.className="mouseover";}};jsAuto.prototype.domouseout=function(obj){ obj.tagName=="DIV" ? obj.className="mouseout" : obj.parentElement.className="mouseout";};jsAuto.prototype.doclick=function(msg) { with (this){ if(_r) { _r.value = msg; _o.style.visibility = "hidden"; } else { alert("javascript autocomplete ERROR :\n\n can not get return object."); return; }
document.getElementById("kword").innerText=msg;
}};// object method;jsAuto.prototype.item=function(msg){ if( msg.indexOf(",")>0 ) { var arrMsg=msg.split(","); for(var i=0; i<arrMsg.length; i++) { arrMsg[i] ? this._msg.push(arrMsg[i]) : ""; } } else { this._msg.push(msg); } this._msg.sort();};jsAuto.prototype.append=function(msg) { with (this){ _i ? "" : _i = eval(_i); _x.push(msg); var div = document.createElement("DIV"); //bind event to object. div.onmouseover = function(){_i.domouseover(this)}; div.onmouseout = function(){_i.domouseout(this)}; div.onclick = function(){_i.doclick(msg)}; var re = new RegExp("(" + _v + ")","i"); div.style.lineHeight="140%"; div.className = "mouseout"; if (_v) div.innerHTML = msg.replace(re ,"<font color=red>$1</font>");
div.style.fontFamily = "verdana"; _o.appendChild(div);}};jsAuto.prototype.display=function() { with(this){ if(_f && _v!="") { _o.style.left = _r.offsetLeft; _o.style.width = _r.offsetWidth; _o.style.top = _r.offsetTop + _r.offsetHeight; _o.style.visibility = "visible"; } else { _o.style.visibility="hidden"; }}};jsAuto.prototype.handleEvent=function(fValue,fID,event) { with (this){
var re; _e = event; var e = _e.keyCode ? _e.keyCode : _e.which; _x = []; _f = false; _r = document.getElementById( fID ); _v = fValue; _i = eval(_i); re = new RegExp("^" + fValue + "", "i"); document.getElementById("kword").innerText=fValue;
_o.innerHTML=""; for(var i=0; i<_msg.length; i++) { if(re.test(_msg[i])) { _i.append(_msg[i]); _f = true; } } _i ? _i.display() : alert("can not get instance"); if(_f) { if((e==38 || e==40 || e==13)) { _i.directionKey(); } else { _c=0; _o.childNodes[_c].className = "mouseover"; _s=true; } }
document.getElementById("kword").innerText=document.getElementById("auto").value;}};window.onerror=new Function("return true;");//-->
</script></head><body><!--把下面代码加到<body>与</body>之间-->
<form id="Form1" runat="server">
<table width="100%">
<tr height="20px;">
<td style="background-color:#D8D8D8; width:34451%; height:20px; padding-left: 10px; font-size:8pt; color:#505050;font-family:Arial;">
</td>
</tr>
</table>
<div id="divc" ><!--this is the autocomplete container.--></div><div style="padding-left:50px;"><font color="#076486" style=" border-width:thick; font-size:12pt;">Search IT System:</font>
<input onkeyup="jsAutoInstance.handleEvent(this.value,'auto',event)" id="auto" runat="server" /><script language="javascript">var aa='<%=getname()%>';var jsAutoInstance = new jsAuto("jsAutoInstance","divc");jsAutoInstance.item(aa);
//--></script> <asp:Button ID="SUBMIT" runat="server" OnClick="SUBMIT_Click" Text="Search" Width="65px" Height="26px" />
<asp:TextBox ID="kword" runat="server" Width="0px" BorderWidth="0px"></asp:TextBox>
<a href="opendocment.aspx" target="_blank""><font color="#076486" style=" border-width:thick; font-size:12pt;">View IT System Architecture</font></a><br />
</div>
<!-- #include file="Portal.htm" -->
</form>
</body></html>
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;namespace IT_System_Links
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public static SqlConnection getConn()
{
string strconn = System.Configuration.ConfigurationManager.AppSettings["ITARMConnectionString"];
SqlConnection con = new SqlConnection(strconn);
//con.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["LocalConnectionString"].ConnectionString;
con.Open();
return con;
}
public static DataSet getData(string sql)
{
SqlConnection con = getConn();
SqlCommand sqlcom = new SqlCommand(sql, con);
SqlDataAdapter sqlsda = new SqlDataAdapter(sql, con);
DataSet ds = new DataSet();
sqlsda.Fill(ds);
return ds;
} public string getname()
{ String sql = "select system_id,system_ename from ITARM_SYSTEM";
DataSet dbt = getData(sql);
DataTable dt = dbt.Tables[0];
//Response.Write("<table>");
String ename = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
String ena = dt.Rows[i][1].ToString().Trim();
ename += ena + "," ; }
//Response.Write("</table>");
return ename; } protected void SUBMIT_Click(object sender, EventArgs e)
{
// string SearchKey = "wefwefwefwefwefewfwefw"; string SearchKey = this.kword.Text.ToString().Trim(); string aa = string.Format("<script language=javascript>window.open('QueryPage.aspx?keyword={0}','_blank')</script>", SearchKey);
Response.Write(aa);
Response.Write("<script>document.location=document.location;</script>");
kword.Text = "";
}
}
}