2013年7月1日 星期一

加入我的最愛(JavaScript)

 < script language="javascript" > 
 document.write("< A href=\"javascript:bookmark()\">加入我的最愛< /font >< /A > ");  
< /script >

留言板(ASP)

talk.htm
< script language="javascript" > 
< !--  
function check()  
{  
project=document.myform.project.value;  
word=document.myform.word.value;  
if(project=="")  
{  
alert("沒有輸入主題!"); 
return;  
}  
else  
{  
if(word=="")  
{  
alert("沒有任何留言!"); 
return;  
}  
}  
document.myform.submit();  
}
 -- > 
< /script >

< html > 
< head >< title >留言板< /title >< /head >

< body background="../pic/bg.gif" vlink="#0000FF" >
< form action="../asp/tform.asp" Method=post name="myform" > 
< div align="left" >
< div align="center" > 
< center >  
< table border="1" width="634" height="1" bordercolor="#008000" >  
< tr >  
< td width="607" align="right" height="4" valign="top" colspan="2" > 
< p align="center" >
< font color="#0000FF" >& nbsp;& nbsp;& nbsp;& nbsp;< font size="5" >  < /font > < /font >
< font color="#000000" >< font size="5" >< b >留& nbsp;& nbsp;& nbsp;  言& nbsp;& nbsp;& nbsp; 板< /b >< /font >& nbsp;< /font >
< font color="#0000FF" >& nbsp;& nbsp;< /font >< font color="#0000FF" >  & nbsp;< /font >
< /p >  
< /td >  
< /tr >  
< tr >  
< td width="119" align="right" height="1" valign="top" >姓名:< /td >  
< td width="231" height="1" >< input type="text" name="name" size="27" tabindex="1" >
< font size="2" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;
< font color="#FF0000" >& nbsp;< /font >
< /font >
< /td >  
< /tr >  
< tr >  
< td width="119" align="right" height="1" valign="top" >旅遊地點:< /td >  
< td width="500" height="1" >< input type="text" name="address" size="27" tabindex="2" >< /td >  
< /tr >  
< tr >  
< td width="119" align="right" height="1" valign="top" >主題:< /td >  
< td width="500" height="1" >< input type="text" name="project" size="33" tabindex="3" >< /td >  
< /tr >  
< tr >  
< td width="119" align="right" height="16" valign="top" >  < p align="right" >留言:< /p >  < /td >  
< td width="500" height="16" >
< font size="2" >
< textarea rows="6" name="word" cols="68" tabindex="4" >< /textarea >
< /font >
< /td >  
< /tr >  
< tr >  
< td width="119" align="right" height="87" valign="top" >心情圖示:< /td >  
< td width="500" height="87" valign="top" align="right" nowrap >  
< p align="left" >  
< font size="2" >  
< input type="radio" value="../pic/person1.gif" name="person" tabindex="5" >
< img border="0" src="../pic/person1.gif" width="50" height="61" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp; 
< input type="radio" value="../pic/person2.gif" name="person" tabindex="5" >
< img border="0" src="../pic/person2.gif" width="48" height="62" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;  
< input type="radio" value="../pic/person3.gif" name="person" tabindex="5" >
< img border="0" src="../pic/person3.gif" width="49" height="62" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;  
< input type="radio" value="../pic/person4.gif" name="person" tabindex="5" >& nbsp;& nbsp;
< img border="0" src="../pic/person4.gif" width="44" height="61" >
< br >  
< input type="radio" value="../pic/person5.gif" name="person" tabindex="5" >& nbsp;& nbsp;
< img border="0" src="../pic/person5.gif" width="53" height="59" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;  
< input type="radio" value="../pic/person6.gif" name="person" tabindex="5" >& nbsp;& nbsp;
< img border="0" src="../pic/person6.gif" width="51" height="59" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;  
< input type="radio" value="../pic/person7.gif" name="person" tabindex="5" >& nbsp;& nbsp;
< img border="0" src="../pic/person7.gif" width="42" height="56" >  & nbsp;& nbsp;& nbsp;& nbsp;& nbsp;
< input type="radio" value="no" name="person" tabindex="5" checked >
< /font >
< font color="#FF0000" >不選擇< /font >
< font size="2" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;< /font >
< /p >  
< /td >  
< /tr >  
< /table >  
< /center >  
< /div >
< /div > 
< p align="center" > 
< input type="button" value="留言" tabindex="6" onclick="check()" >
< font size="2" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp; & nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp; < /font >
< a href="../asp/tbook.asp" target="_self" >觀看留言板< font size="2" >& nbsp;< /font >< /a >
< font size="2" >& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp; < /font >
< input type="reset" value="清除" name="reset" tabindex="7" >
< /p >  
< /form >  
< /body >                                              
< /html >

< html >
< head >< title >留言板< /title >< /head >
< body background="../pic/bg.GIF" vlink="#0000FF" > 
< /html >

tbook.asp
< HTML >
< HEAD >< TITLE >留言板< /TITLE >< /HEAD >
< BODY background="../pic/bg.gif" vlink="#0000FF" >
< H2 ALIGN=CENTER >
< b >留& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;言& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;& nbsp;板< /b >
< img border="0" src="../pic/acdrule.gif" width="100%" height="10" >
< /H3 >
< % 
SQL = "Select * From tbook Order By time DESC" 
Set conn = Server.CreateObject("ADODB.Connection") 
DBPath =Server.MapPath("../db/free.mdb") 
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &DBPath 
SET rs =Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,3,2 
If rs.BOF=True Then 
Response.Write "< h2 >< p align=center >抱歉目前無資料!< /p >< /h2 >" 
Response.Write "< p align=center >< a href=""javascript:history.back()"" >返回上一頁< /a >< /p >"
Response.End 
End If 
Page = CLng(Request("Page")) rs.PageSize=5 
If Page <  1 Then Page = 1 
If Page  > rs.PageCount Then Page = rs.PageCount 
ShowOnePage rs, Page
% >
< DIV ALIGN=right >
< A HREF="../html/talk.htm" >開始留言< /A >
< A HREF="../index.htm" >回首頁< /A > 
< %  
If Page <  > 1 Then Response.Write "< A HREF=tbook.asp?Page=1 >第一頁< /A > " 
Response.Write "< A HREF=tbook.asp?Page=" & (Page-1) & " >上一頁< /A > " 
End If 
If Page <  > rs.PageCount Then Response.Write "< A HREF=tbook.asp?Page=" & (Page+1) & " >下一頁< /A > " 
Response.Write "< A HREF=tbook.asp?Page=" & rs.PageCount & " >最後一頁< /A > " 
End If
% >
頁次:< FONT COLOR="Red" >< %=Page% >/< %=rs.PageCount% >< /FONT >
< /BODY >
< /HTML >
< %  
Sub ShowOnePage( rs, Page ) 
rs.AbsolutePage = Page 
For iPage = 1 To rs.PageSize 
RsToTbook rs rs.MoveNext 
If rs.EOF Then Exit For 
Next 
End Sub  
Sub RsToTbook( rs ) 
word=Replace(rs("word"), vbCrLf, "< BR >" ) 
If Len(rs("pic")) <  > 0 Then PicHTML = "< IMG SRC=" & rs("pic") & " >" 
Else PicHTML = "" 
End If
% >
< p align=left >
< TABLE BOBDER=0 WIDTH=640 > 
< TR >< TD WIDTH=60 >< %=PicHTML% >< /TD > 
< TD width=200 > 
< table bobder=0 align=left > 
< TR > < td >主 題:& nbsp;< %=rs("project")% >< /TD > < /TR > 
< TR > < TD >姓名:& nbsp;< %=rs("name")% >< /TD > < /TR > 
< TR > < td >時 間:< %=rs("time")% >< /TD > < /TR > 
< /table > 
< /TD > 
< TD width=380 BGCOLOR=#00FFFF valign="top" align=left >< %=word% >< /TD >  
< /TR >
< /TABLE >
< img border="0" src="../pic/acdrule.gif" width="100%" height="10" >
< % 
End Sub
% >

計數器(ASP)

< %
If Session("counter")=Empty Then
 Set conn = Server.CreateObject("ADODB.Connection")
 DBPath =Server.MapPath("../db/free.mdb")
 conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &DBPath
 SET rs =Server.CreateObject("ADODB.Recordset")
 rs.open "counter",conn,3,2
 If rs.BOF=True Then
 rs.AddNew
 rs("counter")=0
 rs.Update
 End If
 rs("counter")=rs("counter")+1
 rs.Update
Else
 Set conn=Server.CreateObject("ADODB.Connection")
 DBPath=Server.MapPath("../db/free.mdb")
 conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" &DBPath
 SET rs=Server.CreateObject("ADODB.Recordset")
 rs.open "counter",conn,3,2
 If rs.BOF=True Then
 rs.AddNew
 rs("counter")=0
 rs.Update
 End If
End If
Session("counter")=rs("counter")
% >

< html >

< head >
< title >計數器< /title >
< /head >

< body bgcolor="#0000FF" vlink="#0000FF" >
< font color="#FFFF99" >< %=rs("counter")% >< /font >
< /body >

< /htm l>

猜數字(C語言)

/* 猜數字遊戲 */
/* 使用C為開發工具 */
#include /* 包含DOS I/O函數 */
#include /* 包含亂數函式 */
#include /* 包含直接I/O函式 */

/* 程式開始 */
void main(void)
{
 clrscr();
 int i,j,k=0,l=0; /* k,l判斷A,B */
 char answer[5],input[4]; /* answer為答案;input為玩家輸入*/
 answer[0]=58; /* char為'0' */
 randomize(); /* 設定亂數由時間取得 */
 while(1) /* 進入遊戲 */
 {
 /* 電腦產生數值 */
 for(i=1;i
 {
 answer[i]=rand()%11+48; /* 亂數值介於1-10,除以質數 */
 /* 判斷是否有重複值 */
 for(j=0;j
 {
 if(answer[i]==answer[j])
 {
 i--;
 break;
 }
 }
 }
 /* 玩家開始玩遊戲 */
 while(1)
 {
 printf("\nPlease input four number or input Esc to exit:\n");
 /* 得到玩家輸入的值 */
 for(i=0;i
 {
 input[i]=getche();
 /* 假如輸入為esc則for迴圈 */
 if(input[i]==27)
 break;
 /* 判斷玩家輸入是否為0-9的數目 */
 if(input[i]57)
 {
 printf("\nWrong! You are not input number:\n");
 i=-1;
 }
 /* 判斷玩家是否輸入相同的值 */
 for(j=0;j
 {
 if(input[i]==input[j])
 {
 printf("\nWrong! You are input repeat number9:\n");
 i=-1;
 break;
 }
 }
 }
 /* 假如輸入為esc則跳出while迴圈並設key為1跳出遊戲 */
 if(input[i]==27)
 break;
 /* 判斷為多少A多少B */
 for(i=0;i
 {
 for(j=1;j
 {
 if(input[i]==answer[j])
 {
 if(i==j-1)
 k++;
 else
 l++;
 }
 }
 }
 /* 4A為正確 */
 if(k==4)
 {
 printf("\nYou are right!\n");
 k=0;
 l=0;
 break;
 }
 /* 輸出AB */
 else
 {
 printf("\n%dA%dB\n",k,l);
 k=0;
 l=0;
 }
 }
 /* 要繼續玩輸入'y' */
 printf("\nIf you want to play, please input y:\n");
 if(getche()!='y')
 break;
 }
}

2013年6月17日 星期一

VirtualBox共用資料夾for Ubuntu

要讓VirtualBox(免費軟體)裡的Ubuntu可以存取Windows上的資料夾,
可以透過VirtualBox的共用資料夾來達成.
首先須先安裝VirtualBox的Additions.
底下是開啟VirtualBox Ubuntu OS, 無縫模式(很方便操作Windows與VirtualBox視窗),
可以在底下的toolbar看到.
跳出光碟選項, 選擇Autorun.
Run~
正在安裝.
設定VirtualBox共用資料夾.



在Ubuntu上掛載它吧~
先建一個work的目錄,
將共用資料夾掛載到work上~
哈哈, 看到它了~ YA!!!

讓Virtual Box可連線上網

簡單選擇Virtual Box NAT網卡設定
Virtual Box OS網路會自動獲得IP
透由NB Wi-Fi上網
瀏覽Google

煩, 又要重灌電腦. 我的電腦必裝軟體~

首先要先裝的當然是~~~ 作業系統啦! 哈!!!

雖然現在Linux介面也做得很不錯, 不過還是不習慣.
64bits OS現在好像很流行, 每台筆電都搶著搭, 不過好多軟體都不能用, 尤其工作用的.
所以還是裝了大家常用的windows 7 x86版本(32位元).
而且現在買筆腦好煩, 都買不到不含OS的, 所以自然而然OS就是windows 7正版啦! 哈哈!
(難道我不能選擇自己要用的OS =.=|||)

Windows 7

OS安裝了, 驅動程式也安裝完畢, 再來要安裝什麼呢?
Office? 不對!!! 瀏覽器? 不對!!!
當然是安裝防毒軟體啦!
在這動不動就中毒的世界, 當然不希望剛裝好OS就中毒吧!
就算沒有因為中毒而口吐白沫, 也會因為一直再重安裝而翻白眼吧! 哈!!!
不過要裝防毒, 當然要裝能定期自動更新病毒碼的囉!

雖然用過頗有名氣的小紅傘, 不過常常會跳出廣告視窗, 煩人啊!!! 不過免費的, 沒資格抱怨:)

小紅傘 下載

後來用了不會跳廣告的AVG, 雖然不錯用, 但是下載要輸入e-mail而且還是有使用期限的.

AVG 下載

最後覺得麻煩, 裝了微軟提供的防毒了.
純粹是因為免費, 無使用期限, 可定時更新病毒碼.
雖然會驗證作業系統是否為正版, 不過現在筆電也很難買到不含作業系統的了=.=

Microsoft Security Essentials 下載

再來就是安裝Office啦!

雖然有免費的Office, 但是與微軟的相容性還是有問題啊!!! 好可惜!!!
工作常用到, 所以還是放棄吧!

OpenOffice 下載

工作所需, 想辦法弄到微軟的Office吧! 當然當然要是正版的啦:)P
裝上最新版的Office 2010囉!

Office 2010

完成了, 上Windows Update更新一番吧! 唉! 裝到現在已經過好久了~
人生就是該浪費在一次又一次的重新安裝上. (天啊! 有誰能拯救我啊!)

好了, 不要再廢話了, 還是趕快把電腦用的軟體, 裝一裝:)

商業軟體聯盟(BSA)又開始查緝盜版了, 連電視都在廣告了.
我沒用盜版唷沒用唷!!!
還好現在有很多的免費軟體:)
不然都用正版, 就等於每天捧幾十萬的東西在身邊! 要是掉了, 就哭了!!!

瀏覽器 (要上網下載軟體, 當然要先有瀏覽器啦!)

IE8 (幾乎所有網頁都能上, 但是...)

Opera 下載 (自己喜歡用, 但是怎麼沒有繁體中文官網@@, 爭取繁體中文啦!)


Chrome 下載 (聽說是地表最速) 

Firefox 下載 (開放, 很多好用工具)

解壓縮軟體 (很多軟體下載下來都是壓縮檔, 當然要先裝解壓縮軟體囉!)

7-Zip 下載

虛擬光碟 (現在薄型筆電都沒有內建光碟, 使用ISO檔真方便)

Daemon 下載 (沒有繁體中文官網啦@@)


Virtual CloneDrive 下載

燒錄軟體 (將光碟轉成ISO來用吧!!!)

InfraRecorder 下載

讀Pdf檔

Adobe Reader 下載

轉Pdf檔

BullzipPDFPrinter 下載

常常要寫程式, 最習慣的還是UltraEdit, 可是要錢的啊!
公司有買, 不過自己還是用免費的囉!

Notepad++ 下載 (不錯用, 可是聽說不能另存成其他編碼)

PSPad 下載 (自己用的軟體)


gedit 下載 (Linux上有名的軟體)
 

比較資料夾與檔案

DiffMerge 下載

多媒體編解碼

K-Lite Codec Pack 下載

播放器

KMPlayer 下載


MPC-HC 下載 (輕量播放器)
 

轉碼軟體

Format Factory 下載

看圖軟體

FastStone Image Viewer 下載

繪圖軟體

GIMP 下載

檔案總管 (左右兩個視窗, 方便的搜尋功能)

FreeCommander 下載

Windows Live Messenger

Messenger 下載

FTP下載

FileZilla 下載

PPS (看網路電視, 電影???)

PPS 下載

虛擬機器 (需要安裝測試其他的OS嗎^^)

VirtualBox 下載

執行簡體程式

AppLocale 下載

Gavotte RAMDisk (32位元的OS不能使用到4GB的RAM啦! 多的只好拿來當虛擬記憶體囉!)

RAMDisk 下載

清理作業系統

CCleaner 下載

硬碟重組

Defraggler 下載

軟體移除工具

Software Removal Tool 下載

不習慣用備份軟體, 因為常常還原後, 某些軟體執行都會怪怪的, 總是會發生些問題.
也不習慣壓縮備份資料. 反正現在硬碟也不會太貴, 用了兩顆硬碟,
一顆備份電腦資料, 另一顆做第二備份, 以便貴重資料遺失~


備份很重要的, 之前朋友的硬碟掛了, 裡面都是小孩子珍貴的照片~
幫朋友花了好多時間, 試了幾款軟體, 還好大部分都救回來了...
不然不只我朋友難過, 他老婆也會哭吧!!! 備份很重要的~