當前位置:首頁 » 編程語言 » c語言天氣預報代碼
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

c語言天氣預報代碼

發布時間: 2022-10-16 12:09:45

㈠ 求天氣預報代碼

我的網站用的代碼:http://jj.infocom.cn酒嘉市場信息網
這是泰安的天氣預報代碼,看你需要那種樣式
樣式一代碼:<iframe src="http://www.tianqi123.com/small_page/chengshi_1632.html" width=178 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>
樣式二代碼:<iframe src="http://www.tianqi123.com/small_page/chengshi_1632.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=178&text=no" width=178 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>
樣式三滾動代碼:<iframe src="http://www.tianqi123.com/small_page/chengshi_1632.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語言,您還可以在iframe代碼中的url後面加參數,如:
chengshi_321.html?c0=F9DC68&c1=white&c2=FEFCE0&t1=red&bg=white&w=178&h=250&text=no

其中 c0 表示 表格第一行背景顏色,c1,c2表示表格其他行間隔的背景顏色,t1表示 標題顏色,bg 表示頁面北京顏色,w表示表格寬度 h 表示表格高度

當 text=yes 時,將會出現滾動的天氣文字,建議您自己調試看看,如:
chengshi_321.html??c0=red&c1=FF9900&bg=F4FFF4&w=178&h=20&text=yes

注意:顏色請不要加 # 符號,如 #FF9900 請寫成 FF9900
歡迎訪問我的網站

㈡ 天氣預報代碼

根據IP地址,顯示當地的天氣預報:
<iframe src="http://www.tianqi123.com/php/current_city.php" width=178 height=248 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no align=center id=url></iframe>

第二個:265的.
<iframe src=http://www.cms52.cn/cms/20080301/"http://weather.265.com/weather.htm" width="168" height="54" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no">
</iframe>

第三個:騰訊QQ的:
<iframe SRC='http://weather.qq.com/inc/ss258.htm' id='ifm2' WIDTH='189' HEIGHT='190' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO'></iframe>

第四個:還是騰訊QQ的:
<iframe SRC=http://www.cms52.cn/cms/20080301/"http://weather.qq.com/24.htm" id='ifm1' WIDTH='405' HEIGHT='332' ALIGN='center' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO'></iframe>

再送你一款QQ電台的調用,蠻小巧的:
<IFRAME marginWidth=0 marginHeight=0 src=http://www.cms52.cn/cms/20080301/"http://listen.qq.com/cj/player.htm" frameBorder=0 width=255 scrolling=no height=30></IFRAME>

㈢ c# winform 如何顯示天氣預報

不要聽網上這些人的風言風語,我們都是用WebBrowser來完成這個操作的,直接把url賦值給WebBrowser就了事,何必一大堆一大堆的代碼,天氣預報終究是運營商提供的,哪天他停止了服務,你又要去修改代碼,不覺得可笑嗎?

我的方法是:建立一個本地ACCESS資料庫,設置好他的密碼,在裡面做一個表,存儲各個城市url和各個城市名,url是在網站上獲取的,比如:http://tianqi.xixik.com,提供你所需要的城市天氣預報代碼:http://cache.xixik.com.cn/1/hefei/是合肥的http://cache.xixik.com.cn/1/beijing/是北京的...

你要做的事情很簡單,只需要讀取資料庫,給WebBrowser分配url就好了,資料庫放在程序相對路徑裡面,可以增刪查,防止這個網站沒用了還可以維護,打包程序的時候把資料庫格式改成.bat或者.cab,連接字元串里,也要改掉,這樣資料庫就只佔幾個KB空間。

c語言 輸入一個月及每日氣溫(含有1位小數),程序輸出該月平均,最高和最底氣溫

#include<stdio.h>

int main()

{

int days;
float sum,max,min,temp;

max=sum=0.0;
min=100.0;
printf("請輸入當月的天數:");
scanf("%d",&days);
for(int i=0;i<days;i++)

{

printf("請輸入%d日的氣溫:",i+1);

scanf("%f",&temp);

sum+=temp;

max=max<temp?temp:max;

min=min>temp?temp:min;

}

printf("當月最高氣溫:%.1f\n",max);

printf("當月最低氣溫:%.1f\n",min);

printf("當月平均氣溫:%.1f\n",sum/days);

return 0;

}

㈤ 如何用C語言獲取天氣預報

可以使用第三方http庫,調用天氣預報網站的相關api來獲取數據
當然如果你對http熟悉的話,也可以用socket自己實現

㈥ 求天氣預報網站代碼(有要求)

<iframe
src="http://m.weather.com.cn/m/p6/weather1.htm"
width="220"
height="30"
marginwidth="0"
marginheight="0"
hspace="0"
vspace="0"
frameborder="0"
scrolling="No"></iframe>
上面這段代碼顯示的是訪問這個網站的人所在城市的天氣情況。
如果需要設置城市的話可以訪問這個網址:
http://www.tianqi123.com/main/small_page.html?url=http://www.tianqi123.com/tianqi/chengshi_1.html&city_name=北京
根據需要輸入城市名稱,生成你想要的代碼

㈦ 課設求救,用C語言做天氣預報

進行c語言網路編程? 從網上獲取天氣預報信息? 關鍵是網上天氣預報有相應的介面沒,怎麼獲取,然後你處理一下結果就差不多了。

㈧ 可選擇城市的天氣預報代碼

<center><p><b>天 氣 預 報</b></cenier>
<center><iframe width=157 height=240 frameborder=0 scrolling=NO src='http://appnews.qq.com/cgi-bin/news_qq_search?city=城市名稱></iframe></center>

說明:城市名稱寫下面的代碼
中國其他各省(區)天氣的代碼只需將上述代碼中的 cncn 換成下列字元串:
廣東: gudp 福建: fujp 浙江: zhjp 江蘇:jsup 安徽: anhp 山東: shdp
海南: hanp 廣西: guxa 貴州: guzp 雲南:yunp 四川: sicp 陝西: saxp
河南: henp 河北: hebp 山西: shxp 內蒙古:nema 遼寧: linp 吉林: jilp
黑龍江: hljp 湖北: hubp 湖南: hunp 江西:jixp 甘肅: gasp 寧夏: nixa
青海: qihp 西藏: xiza 新疆: xija
其它國家天氣的代碼只需將上述代碼中的 cncn 換成下列字元串: :
德國:dldl 美國:naus 加拿大:naka 亞洲:asie 歐洲:euro
日本:japn 韓國:skor 朝鮮:nkor

㈨ 聊城天氣預報的代碼

天氣預報的源代碼:(多種樣式) 1,多功能式天氣預報源代碼: <IFRAME ID='ifm2' WIDTH='189' HEIGHT='190' ALIGN='CENTER' MARGINWIDTH='0' MARGINHEIGHT='0' HSPACE='0' VSPACE='0' FRAMEBORDER='0' SCROLLING='NO' SRC='http://weather.qq.com/inc/ss125.htm'></IFRAME> 2,橫框式天氣預報源代碼: <form action="http://www.t7online.com/cgi-bin/suchen" method="GET" target="_top"> <font face="宋體" size="2" color="#ff0000"><b>輸入城市名稱</b><br></font> <input type="text" size="10" maxlength=20 name="ORT"><input type="hidden" name="LANG" value="cn"> <input type="submit" value="查詢天氣"></form> 3,QQ氣象源代碼: <iframe src="http://weather.265.com/weather.htm" width="160" height="54" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> 4,可以同時出現四個城市的天氣情況的源代碼: <iframe width="145" height="130" border="0" align="center" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" src="http://minisite.qq.com/Weather/news_new.html" allowTransparency="true"></iframe> 5,只能出現一個城市天氣情況的源代碼: <IFRAME id=ifm2 align=center marginWidth=0 marginHeight=0 src="http://weather.qq.com/inc/ss125.htm" frameBorder=0 width=189 scrolling=no height=190></IFRAME><DIV></DIV> 具體操作步驟是: 點擊控制面板——個人首頁維護——自定義空白面板——新增——鉤選「顯示源代碼」前的小方框(出現鉤號,同時文檔里出現DIV的字樣)——復制粘貼上面任何一組代碼——再次鉤選「顯示源代碼」前的小方框(鉤號消失)——保存——返回自定義設置——定製我的首頁——添加模塊——勾選新增面板——保存設置就行了; 改變默認城市的步驟: 1,拖動該圖片,讓它獨自在一個新的網頁出現; 2,查找你要的城市的天氣預報,然後復制其網址; 3,把復制的網址粘貼到原來的網址上;

㈩ 單一城市的天氣預報代碼怎麼寫越簡單越好

//給你一個網址
//http://m.weather.com.cn/data/101010100.html
//http://blog.csdn.net/hello_haozi/article/details/7564223
NSString *shangHai = @"http://m.weather.com.cn/data/101020100.html";

NSOperationQueue *queue = [[NSOperationQueue alloc] init];

NSURL *url1 = [NSURL URLWithString:shangHai];

NSURLRequest *request1 = [[NSURLRequest alloc] initWithURL:url1];

[NSURLConnection sendAsynchronousRequest:request1 queue:queue completionHandler:^(NSURLResponse *response, NSData *da, NSError *error) {

if (da) {

NSDictionary *shangHaiDict = [NSJSONSerialization JSONObjectWithData:da options:NSJSONReadingMutableLeaves error:&error];

NSLog(@"%@",shangHaiDict);

}

}];
這是上海的天氣 ,不知道是否回答了你的問題