2009年12月8日 星期二
2009年11月25日 星期三
C#.NET 根據GridView 的欄位值來改變顯示
有時後在DataSource查詢出來的資料,利用GridView 顯示可能不合理想或想作多一點的改變
可以自己另外寫副程式,來改變顯示
比如有一個DateSource查詢出來是這樣子
| 學生\科目 | 國文 | 數學 | 英文 |
| 小英 | 50 | 60 | 80 |
| 小明 | 80 | 33 | 50 |
但你想要把輸出時,不及格以紅字,粗體顯示,或咖別的處理,可以使用GridView 中的onrowdatabound 指定副程式
<script language="C#" runat="server"> protected void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[1].Text <= 59) { e.Row.Cells[1].Text = "<span style=\"color: #ff0033\"><b>" + e.Row.Cells[1].Text + "</b></span>"; } if (e.Row.Cells[2].Text <= 59) { e.Row.Cells[2].Text = "<span style=\"color: #ff0033\"><b>" + e.Row.Cells[2].Text + "</b></span>"; } if (e.Row.Cells[3].Text <= 59) { e.Row.Cells[3].Text = "<span style=\"color: #ff0033\"><b>" + e.Row.Cells[3].Text + "</b></span>"; } } } </script> <asp:sqldatasource id="CustomersSqlDataSource" selectcommand="Select [name] as '學生\科目', [Chin] as '國文', [Math] as '數學', [Engl] as '英文' From [Results]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"> </asp:sqldatasource> <asp:gridview id="Gridview1" datasourceid="CustomersSqlDataSource" onrowdatabound="CustomersGridView_RowDataBound" runat="server"> </asp:gridview> |
輸出:
| 學生\科目 | 國文 | 數學 | 英文 |
| 小英 | 50 | 60 | 80 |
| 小明 | 80 | 33 | 50 |
參考文件:http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
2009年10月30日 星期五
Linux自動更新系統時間
/etc/cron.daily/資料夾為每天都會報行的程式
但也給予執行權限
#vi /etc/cron.daily/updatetime.sh
| #!/bin/bash /usr/sbin/ntpdate tock.stdtime.gov.tw && /sbin/hwclock -w |
這樣每天就會自動去 tock.stdtime.gov.tw ntp server更新同步自己的linux主機時間
2009年10月24日 星期六
微處理機 8051-無線遙控車
2009年10月19日 星期一
Winodws 的 Mount磁區
現在磁碟愈來愈多,外接設備也是常插來插去的,4in1讀卡機等等,一些電腦的專業玩家,免不了C D E F.... Y Z個字母都用完了

這種情況下,以過去的磁碟機代號就不夠用了,那只好使用Mount 的掛載方式這種掛載本來就有的觀念,只是大家都被Microsoft的檔案系統洗腦而已,大家只要把捷徑的觀念引用在Mount 的架構上就可以了
過去,是直接把一個分割區給予一個英文代號來作一個root(根),其實也可以把資料夾改指向分割區位置的,用這個方法,就可以解決磁碟代號不足的問題了





2009年3月16日 星期一
你的手機也可以上MSN喔
支援很多IM程式, Skype®, MSN Messenger®, Google Talk™, ICQ, SIP, Twitter, Yahoo!™ and AIM®.
而且支援很多很多手機喔,最近發表的nokia 5800 也可以使用它來聊msn
Nokia 5800 fring下載
SonyEricsson UIQ3 fring
官方網站http://www.fring.com/
你的手機不能放Avi檔嗎?試試這個吧
你的手機不能放avi影片嗎?
DivX現在有手機行動版的免費播放器
0.91版,是2008年10月份發佈的
可以使你的手機可以放出儲存在記憶卡上的影片
支援多種手機SonyEricsson, Nokia, Windows Mobile....
已另上傳備份--DOWNLOAD
Nokia請安裝S60版
SonyEricsson請安裝UIQ3版
WINDOWS 請安裝SP或PPC版
DivX Mobile Player Download Page
Thu, 04/24/2008 - 13:34 — divxbrigBelow you will find download links for all the different DivX Mobile Player builds. Please download according to your phone's OS. You must subscribe to the DivX Mobile Community to access the download.
Please note that you DO NOT have to install the DivX Mobile Player if your phone is a DivX Certified device. For a full list of DivX Certified phones check out the phone list on the DivX Mobile website.
Thanks,
divxbrig
Download DivX Mobile Player
v0.91 (30-Sep-2008)
Choose the version that matches your phone:
- Windows Mobile 5 Smartphone
- Windows Mobile 5 Pocket PC
- Symbian OS 9 S60 3rd Edition
- Symbian OS 9 UIQ 3.0
- Windows Mobile 6 Standard
- Windows Mobile 6 Classic
- Windows Mobile 6 Professional
Unfortunately, many phones are incompatible with DivX Mobile Player. Unsupported phones include the following:
- Pocket PC 2003 and earlier
- Symbian OS 9.4 and 9.5 (Nokia 5800)
- Symbian S60 2nd Edition and earlier
- Symbian UIQ 2.0 and earlier
- Palm Garnet OS
- Apple iPhone
- Blackberry
- Android
It is not necessary or recommended to install DivX Mobile Player on a DivX Certified phone. For more information, see DivX Certified Phones.
官方網站
http://www.divx.com/mobile/phones.php






