求VB编写气象风级查询程序的源代码。

求VB编写气象风级查询程序的源代码。,第1张

启动vb 新建一个“标准exe”工程

在控件工具箱上 选定 按钮 CommandButton 然后在亩州窗体上画一个按钮出来

双击按钮迅晌蔽,你可以看到下面这两行

Private Sub Command1_Click()

End Sub

把这两行删除

把下面的代码粘贴在里面

启动执行

Private Sub Command1_Click()

Dim a(12) As String

Dim t As String

'3~11级跟上面格式对齐补充在引号内

t = "风级 名称 风速(m/s) 陆地物象 海面波浪 浪高(米) "

a(0) = " 0 无风 0.0-0.2 烟直上 平静 0.0 "

a(1) = " 1 软风 0.3-0.15 烟示风向 微波峰无泡沫 0.1 "

a(2) = " 2 清风 1.6-3.3 感觉有风 小波峰未破碎 0.2 "

a(12) = "12 飓风 32.2-36.9 摧毁巨大 海浪滔天 14.0 "

a(3) = ""

a(4) = ""

a(5) = ""

a(6) = ""

a(7) = ""

a(8) = ""

a(9) = ""

a(10) = ""

a(11) = ""谨握

Dim n As Integer

n = Val(InputBox("请输入风级", "输入风级", 0))

If n >12 Or n <0 Then

MsgBox "输入的数应在0~12之间"

Else

Cls

Print t

Print a(n)

End If

End Sub

<?php    

$URLStyle = "http://flash.weather.com.cn/wmaps/xml/%s.xml"    

$chinaURL = sprintf($URLStyle, "china")    

$chinaStr = file_get_contents($chinaURL)    

$chinaObj = simplexml_load_string($chinaStr)    

$chinaObjLen = count($chinaObj->city)    

echo "chinaObjLen = ".$chinaObjLen."\n"    

for ($i=0$i<$chinaObjLen$i++){    

//遍历省一级节点,共37个    

        $level1 = $chinaObj->city[$i]["pyName"]    

        $shengjiURL = sprintf($URLStyle, $level1)    

        $shengjiStr = file_get_contents($shengjiURL)    

        //echo $shengjiStr    

        $shengjiObj = simplexml_load_string($shengjiStr)     

        $shengjiObjLen = count($shengjiObj->city)    

//      echo $chinaObj->city[$i]["quName"]    

//      echo " ".$shengjiObjLen."\n"    

        for ($j=0$j<雀仿肆$shengjiObjLen$j++){    

        //遍历市一级节点    

                $level2 = $shengjiObj->city[$j]["pyName"]    

                $shijiURL = sprintf($URLStyle, $level2)    

                $shijiStr = file_get_contents($shijiURL)    

                //echo $shijiStr    

                $shijiObj = simplexml_load_string($shijiStr)     

             //直辖市和海南、台湾、钓鱼岛等没有县级节点    

                if(!$shijiObj){    

                        echo "WARNNING: not exsit next level node. - ".$level1."-".$shijiURL."\n"    

                        echo '  "'.$shengjiObj->city[$j]["cityname"].'" => '    

                        echo $shengjiObj->city[$j]["url"].",\n"    

                        continue    

                }    

                $shijiObjLen = count($shijiObj->city)    

                //echo $shengjiObj->city[$j]["cityname"]."  "    

                //echo $shijiObjLen."\n"    

                for ($k=0$k<$shijiObjLen$k++){    

                //遍历县一级节点    

                   顷轿     $xianji_code = $shijiObj->city[$k]["url"]    

                        echo '  "'.$shijiObj->city[$k]["cityname"].'" => '    

          大虚              echo $shijiObj->city[$k]["url"].",\n"    

                        //echo $xianji_code."\n"     

                }    

        }    

}           

//print_r($chinaObj)    

?>

通过XML接口根节点递归获得全国几千个县以上城市cide code的代码

hao123网站左上的天气预报网页代码如下:

<iframe src=

"http://www.tianqi123.com/small_page/chengshi_2250.html?

c0=red&c1=D96C00&bg=F4FFF4&w=178&h=20&text=yes"

width=178 height=21

marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no

align=center id=url></iframe>

制作网页时常用的代码有HTML,JavaScript,ASP,PHP,CGI等,其中超文本标友岩记语言(标准通用标记语言下的一个应用、外语简称:HTML)是最基础的网页代码。

扩展资料:

网页代码的一些简单使用:

<marquee>...<好者御/marquee>普通卷动

<marquee behavior=slide>...</marquee>滑动

<marquee behavior=scroll>...</marquee>预设卷动

<marquee behavior=alternate>...</marquee>来回卷动

<marquee direction=down>...</marquee>向下卷动

<嫌弯h1>...</h1>标题字(最大 )

<h6>...</h6>标题字(最小)

<b>...</b>粗体字

<strong>...</strong>粗体字(强调)

<br>(换行)

<nobr>...</nobr>水域(不换行)

<p>...</p>水域(段落)

<center>...</center>置中

参考资料来源:百度百科-网页代码


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/12329285.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存