开发者

Creating a Google search form that only returns C# results

I know that I can create a google开发者_C百科 search box on my personal homepage using something like this (very basic code)

<form method="get" action="http://www.google.com/search">
       <input type="text"  name="q"  />
    <input type="submit" value="Google Search" />
</form>

Is it possible to change this to only return results containing C#.

If I enter stringbuilder, the above code submits http://www.google.com/search?q=stringbuilder

whereas I want is http://www.google.com/search?q=c%23+stringbuilder


Google supports multiple q arguments. You can generate URLs like this: http://www.google.com/search?q=text1&q=text2. In your case, add a hidden input:

<input type="hidden" name="q" value="C#" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜