.NET开发

本类阅读TOP10

·NHibernate快速指南(翻译)
·vs.net 2005中文版下载地址收藏
·【小技巧】一个判断session是否过期的小技巧
·VB/ASP 调用 SQL Server 的存储过程
·?dos下编译.net程序找不到csc.exe文件
·通过Web Services上传和下载文件
·学习笔记(补)《.NET框架程序设计(修订版)》--目录
·VB.NET实现DirectDraw9 (2) 动画
·VB.NET实现DirectDraw9 (1) 托管的DDraw
·建站框架规范书之——文件命名

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
Flex中使用Google

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

以下是我的google搜索

首先的申请一个Account,然后得到他的lisence Key
这样就可以根据wsdl来构造xml提交给api。

程序如下:



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" verticalGap="10">
    <mx:Style>
.blankFont {font-size:12;}
    </mx:Style>
    <mx:WebService id="ws" wsdl="http://api.google.com/GoogleSearch.wsdl"
        showBusyCursor="true">
        <mx:operation name="doGoogleSearch">
            <mx:request>
                <!--This is my Lisence Key-->
                <key>JRuYnw9QFHKM5XYgSMigEbOleKWNr3Qk</key>
<q>{q.text}</q>
                <start>0</start>
                <maxResults>10</maxResults>
                <filter>true</filter>
<restrict></restrict>
                <safeSearch>true</safeSearch>
         <lr></lr>
<ie></ie>
<oe></oe>
            </mx:request>
        </mx:operation>
    </mx:WebService>

    <mx:Panel styleName="blackFont" title="Google Search" width="500">
    <mx:HBox>
        <mx:TextInput id="q" width="210"/>
<mx:Button label="Search" click="ws.doGoogleSearch.send()"/>
    </mx:HBox>

    <mx:DataGrid id="resultsGrid" 
dataProvider="{ws.doGoogleSearch.result.resultElements}"
width="100%"
height="400">
<mx:columns>
                <mx:Array>
                    <mx:DataGridColumn columnName="title" headerText="Title" width="120"/>
                </mx:Array>
            </mx:columns>
    </mx:DataGrid>
    </mx:Panel>
</mx:Application>


结果如下图:



本主题包含附件: sf_2004111101824.jpg (34139bytes)





CSDN BLOG:       http://blog.csdn.net/stefli

stefli's MP3:       http://stefli.88ip.net/Flex/mp3Player.swf




相关文章

相关软件