工具
Phaser 是一套免費且開源的 2D 遊戲框架
http://phaser.io/
範例
http://gametest.mobi/phaser/examples/
推荐3款强大的HTML5游戏快速开发工具
http://www.csskoo.com/index.php?option=com_k2&view=item&id=37:%E6%8E%A8%E8%8D%903%E6%AC%BE%E5%BC%BA%E5%A4%A7%E7%9A%84html5%E6%B8%B8%E6%88%8F%E5%BF%AB%E9%80%9F%E5%BC%80%E5%8F%91%E5%B7%A5%E5%85%B7
HTML5开发必备:游戏开发资源合集
http://www.csdn.net/article/2013-03-22/2814606-HTML5-game
一些最新的HTML5和JavaScript遊戲開發引擎
http://www.techfriend.in/zh-tw/HTML5%E5%92%8Cjavascript%E9%81%8A%E6%88%B2%E9%96%8B%E7%99%BCengines.html%E7%9A%84
Google Web Designer
https://www.google.com/webdesigner/
优秀工具推荐:两款很棒的 HTML5 游戏开发工具
http://www.cnblogs.com/lhb25/p/html5-game-develpoe-tools.html
Cocos2d-html5
http://www.cocos2d-x.org/wiki/Cocos2d-html5
遊戲引擎 Cocos2d-html5
http://ithelp.ithome.com.tw/question/10119167?tag=ithome.nq
教學
[Cocos2d-html5] 一步一步学Cocos2d-html5做游戏教程(入门篇)
http://bbs.html5china.com/thread-4509-1-1.html
HTML5 遊戲開發範例整理(1-10)
http://japlinchen.blogspot.tw/2012/10/html5-1-10.html
Google Web Designer 搶先玩 1
http://www.youtube.com/watch?v=5dftkqpFI40
Google Web Designer 搶先玩 2
http://www.youtube.com/watch?v=BkZFhNzVqM4
google也推網頁設計工具-Google Web Designer
http://csscoke.com/2013/10/01/google-web-designer/
衛道程式設計菁英班
https://sites.google.com/a/vtsh.tc.edu.tw/wei-dao-zhong-xue-cheng-shi-jing-ying-ban/android-kai-fa/cocos2d-html5-html5you-xi-kai
Game Maker遊戲設計教學網
http://learn.bles.tp.edu.tw/moodle/course/view.php?id=2
HTML5 遊戲框架:Cocos2d-html5
https://igdshare.org/content/cocos2d_html5
App 開發效益再優化,你應該認識的 Corona SDK
http://techorange.com/2012/04/27/app-develop-corona/
CORONA SDK in Taiwan
http://coronaintaiwan.blogspot.tw/
Lua教程 : 第一個Lua程式
http://www.ptt.cc/bbs/GameDesign/M.1155044927.A.1E1.html
跨平台App 開發:Corona SDK 簡介
http://lets-make-games.blogspot.tw/2013/03/app-corona-sdk.html
CORONA教學第一章認識繪圖系統並寫出CORONA遊戲引擎第一個程式
http://derekcylin.pixnet.net/blog/post/82468021-corona%E6%95%99%E5%AD%B8%E7%AC%AC%E4%B8%80%E7%AB%A0%E8%AA%8D%E8%AD%98%E7%B9%AA%E5%9C%96%E7%B3%BB%E7%B5%B1%E4%B8%A6%E5%AF%AB%E5%87%BAcorona%E9%81%8A%E6%88%B2
分享用Adobe Air向iOS移植游戏的经验
http://gamerboom.com/archives/47931
書:在Android設備上快又有力開發Adobe AIR程式
http://www.books.com.tw/products/0010582932
使用Adobe AIR 開發真正跨平台遊戲Demo
http://7-12.idv.tw/forums/viewthread.php?tid=2295
2013年12月13日 星期五
2013年11月27日 星期三
Ruby 資料
Ruby 使用手冊
http://guides.ruby.tw/ruby/index.html
Rails Guides
http://guides.ruby-china.org/
Ruby on Rails 實戰聖經
http://ihower.tw/rails3/intro.html
Ruby Programming Language 中文官方網頁
https://www.ruby-lang.org/zh_tw/
http://guides.ruby.tw/ruby/index.html
Rails Guides
http://guides.ruby-china.org/
Ruby on Rails 實戰聖經
http://ihower.tw/rails3/intro.html
Ruby Programming Language 中文官方網頁
https://www.ruby-lang.org/zh_tw/
2013年11月23日 星期六
Bonobo Git Server (Simple git server for Windows.) 測試備忘
Bonobo Git Server是一款Windows上的Git Server,它使用IIS即可,走的是Http協定,只要簡單的安裝就能使用,但是因為我的專案大小有1.35GB在 push 的時候一直發生奇怪問題,怕忘記趕快備忘一下。
1.發生RPC FAILURE (RESULT=56)之類,參考URL
http://flyingtomoon.com/2011/04/12/git-push-is-failed-due-to-rpc-failure-result56/
http://blog.xuite.net/misgarlic/weblogic/brick-view/102804976?aid=55236696&mode=brick
https://gitcafe.com/GitCafe/Help/tickets/269?locale=zh-TW
可用 git config http.postBuffer 524288000 將Http buffer加大。
2.發生 fatal: protocol error: bad line length character:<!DO ,參考URL
http://stackoverflow.com/questions/7152285/issue-with-git-hosted-on-iis-with-bonobo
在 Bonobo Web.config file 的 <system.web> 加上
<httpruntime maxrequestlength="2147483647"></httpruntime>
3.我在IIS上的應用程式集區設定上的"工作者處理序上限"也加大到 6 以免IIS記憶體不足。
4.發生error: RPC failed; result=22, HTTP code = 404,參考URL
http://gisgeek.blogspot.tw/2012/03/bonobo-git-server-remote-end-hung-up.html
修改 Bonobo Web.config file
把 requestLimits maxAllowedContentLength="102400"
改到 999999999
5.當版本庫過大在clone時發生錯誤,error: RPC failed; result=22, HTTP code = 500
http://stackoverflow.com/questions/17826660/gitlab-git-clone-https-with-large-repos-fails
試試SSH方式
http://blog.crboy.net/2012/05/git-on-windows.html
http://jerry2yang.wordpress.com/2011/08/22/git-server-with-sshd-on-windows-server/
http://holyhoehle.wordpress.com/2011/08/05/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd-update/
http://blog.pigbaby.com/?p=222
http://jerry2yang.wordpress.com/?s=msysGit
Windows GIT 解決中文顯示亂碼問題
http://jerry2yang.wordpress.com/2011/08/12/windows-git-%E8%A7%A3%E6%B1%BA%E4%B8%AD%E6%96%87%E9%A1%AF%E7%A4%BA%E4%BA%82%E7%A2%BC%E5%95%8F%E9%A1%8C/
用Apache
http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
1.發生RPC FAILURE (RESULT=56)之類,參考URL
http://flyingtomoon.com/2011/04/12/git-push-is-failed-due-to-rpc-failure-result56/
http://blog.xuite.net/misgarlic/weblogic/brick-view/102804976?aid=55236696&mode=brick
https://gitcafe.com/GitCafe/Help/tickets/269?locale=zh-TW
可用 git config http.postBuffer 524288000 將Http buffer加大。
2.發生 fatal: protocol error: bad line length character:<!DO ,參考URL
http://stackoverflow.com/questions/7152285/issue-with-git-hosted-on-iis-with-bonobo
在 Bonobo Web.config file 的 <system.web> 加上
<httpruntime maxrequestlength="2147483647"></httpruntime>
3.我在IIS上的應用程式集區設定上的"工作者處理序上限"也加大到 6 以免IIS記憶體不足。
4.發生error: RPC failed; result=22, HTTP code = 404,參考URL
http://gisgeek.blogspot.tw/2012/03/bonobo-git-server-remote-end-hung-up.html
修改 Bonobo Web.config file
把 requestLimits maxAllowedContentLength="102400"
改到 999999999
5.當版本庫過大在clone時發生錯誤,error: RPC failed; result=22, HTTP code = 500
http://stackoverflow.com/questions/17826660/gitlab-git-clone-https-with-large-repos-fails
試試SSH方式
http://blog.crboy.net/2012/05/git-on-windows.html
http://jerry2yang.wordpress.com/2011/08/22/git-server-with-sshd-on-windows-server/
http://holyhoehle.wordpress.com/2011/08/05/setting-up-a-git-server-on-windows-server-2008-r2-using-msysgit-and-winsshd-update/
http://blog.pigbaby.com/?p=222
http://jerry2yang.wordpress.com/?s=msysGit
Windows GIT 解決中文顯示亂碼問題
http://jerry2yang.wordpress.com/2011/08/12/windows-git-%E8%A7%A3%E6%B1%BA%E4%B8%AD%E6%96%87%E9%A1%AF%E7%A4%BA%E4%BA%82%E7%A2%BC%E5%95%8F%E9%A1%8C/
用Apache
http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
2013年11月10日 星期日
重構文章收集
只是收集備忘,轉載自In91
[ASP.NET]重構之路系列v1 – UI, Business logic, Data access概念分開
http://www.dotblogs.com.tw/hatelove/archive/2011/05/11/asp.net-refactoring-separate-ui-service-data.access.aspx
[ASP.NET]重構之路系列v2 – DRY & Top-Down思考方式
http://www.dotblogs.com.tw/hatelove/archive/2011/05/16/dry-top-down-design.aspx
[ASP.NET]重構之路系列v1 – UI, Business logic, Data access概念分開
http://www.dotblogs.com.tw/hatelove/archive/2011/05/11/asp.net-refactoring-separate-ui-service-data.access.aspx
[ASP.NET]重構之路系列v2 – DRY & Top-Down思考方式
http://www.dotblogs.com.tw/hatelove/archive/2011/05/16/dry-top-down-design.aspx
SOA文章
只是收集備忘,轉載文章.
SOA簡介(一)
http://miin1130.pixnet.net/blog/post/22632521
石頭閒語
個人經驗談現實中的 SOA, part 1 - 實況, 概念與基於動態語言的實踐途徑
http://blog.roodo.com/rocksaying/archives/2660010.html
個人經驗談現實中的 SOA, part 2 - 訊息、訊息、訊息
http://blog.roodo.com/rocksaying/archives/2663647.html
業務流程決定軟體程式,軟體程式追隨業務流程
http://blog.roodo.com/rocksaying/archives/3045651.html
資料管理趨勢,檔案一如資料表,資料表一如檔案
http://blog.roodo.com/rocksaying/archives/2521061.html
論「流程整合」之前的事
http://blog.roodo.com/rocksaying/archives/3114577.html
SOA的輕量化趨勢,從ESB漂移到Mashups
http://blog.roodo.com/rocksaying/archives/10415235.html
微軟
http://www.microsoft.com/taiwan/services/microsoftservices/soa.aspx
其他...
Microsoft .NET 應用系統架構導論
http://60-251-1-52.hinet-ip.hinet.net/taiwan/msdn/columns/200303netappintro.htm
Design Patterns 第二炮 : Factory Pattern , Strategy Pattern
http://netgo2oo.blog.ithome.com.tw/trackbacks/224/903
SOA簡介(一)
http://miin1130.pixnet.net/blog/post/22632521
石頭閒語
個人經驗談現實中的 SOA, part 1 - 實況, 概念與基於動態語言的實踐途徑
http://blog.roodo.com/rocksaying/archives/2660010.html
個人經驗談現實中的 SOA, part 2 - 訊息、訊息、訊息
http://blog.roodo.com/rocksaying/archives/2663647.html
業務流程決定軟體程式,軟體程式追隨業務流程
http://blog.roodo.com/rocksaying/archives/3045651.html
資料管理趨勢,檔案一如資料表,資料表一如檔案
http://blog.roodo.com/rocksaying/archives/2521061.html
論「流程整合」之前的事
http://blog.roodo.com/rocksaying/archives/3114577.html
SOA的輕量化趨勢,從ESB漂移到Mashups
http://blog.roodo.com/rocksaying/archives/10415235.html
微軟
http://www.microsoft.com/taiwan/services/microsoftservices/soa.aspx
其他...
Microsoft .NET 應用系統架構導論
http://60-251-1-52.hinet-ip.hinet.net/taiwan/msdn/columns/200303netappintro.htm
Design Patterns 第二炮 : Factory Pattern , Strategy Pattern
http://netgo2oo.blog.ithome.com.tw/trackbacks/224/903
2013年10月17日 星期四
找到兩種寫程式用還不錯的字型
試了好一會終於找到兩種覺得寫程式還不錯用的字型:
參考:
http://hivelogic.com/articles/top-10-programming-fonts/
http://blog.mosil.biz/2012/07/programming-fonts/
http://www.dotblogs.com.tw/mis2000lab/archive/2009/05/20/coding_font_090520.aspx
- Trebuchet MS
- Monaco
參考:
http://hivelogic.com/articles/top-10-programming-fonts/
http://blog.mosil.biz/2012/07/programming-fonts/
http://www.dotblogs.com.tw/mis2000lab/archive/2009/05/20/coding_font_090520.aspx
2013年10月15日 星期二
GIT教學連結收集
Will 保哥的GIT教學連結收集
Git 學習筆記 (2):30 天精通 Git 版本控管
Pro Git 中文
http://git-scm.com/book/zh-tw/
版本控制系統 Git 精要
使用 Git 1.8
http://ihower.tw/git/index.html
Git Magic
http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_tw/
Git Server on Windows 安裝手記
http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
Bonobo Git Server
http://bonobogitserver.com/
Kenming's 鮮思維
http://www.kenming.idv.tw/tag/subversion
怎样使用 GitHub ?
http://www.zhihu.com/question/20070065/answer/16021641
Git flow
http://www.juvenxu.com/2010/11/28/a-successful-git-branching-model/
Git 學習筆記 (2):30 天精通 Git 版本控管
Pro Git 中文
http://git-scm.com/book/zh-tw/
版本控制系統 Git 精要
使用 Git 1.8
http://ihower.tw/git/index.html
Git Magic
http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_tw/
Git Server on Windows 安裝手記
http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
Bonobo Git Server
http://bonobogitserver.com/
Kenming's 鮮思維
http://www.kenming.idv.tw/tag/subversion
怎样使用 GitHub ?
http://www.zhihu.com/question/20070065/answer/16021641
Git flow
http://www.juvenxu.com/2010/11/28/a-successful-git-branching-model/
2013年10月10日 星期四
CKEditor放在Listview的ItemTemple中有多筆時,只有第一個能正常顯示...
CKEditor放在Listview的ItemTemple中有多筆時,只有第一個能正常顯示...怎辦?
試了很多方法都無效,最後換一個HTML編輯器=>http://www.freetextbox.com/
終於...正常顯示囉...YA
試了很多方法都無效,最後換一個HTML編輯器=>http://www.freetextbox.com/
終於...正常顯示囉...YA
當EF5使用SQL Server而在Code First失敗後,導致無法再自動產生table的原因。
因為先前不當操作發生我的Mebers及ShoppingOrders兩個table在VS2012中EF5一直在SQL Server上Code First失敗,後來一直試都無法再產生。
後來終於找到了無法再自動產生table的原因了,原來在SQL Server上的DB中的系統資料表會因為 Code First 而產生一個_MigrationHistory的table(如下圖),將此table刪除後,再到VS2012重新RUN一次,結果終於可以了。
後來終於找到了無法再自動產生table的原因了,原來在SQL Server上的DB中的系統資料表會因為 Code First 而產生一個_MigrationHistory的table(如下圖),將此table刪除後,再到VS2012重新RUN一次,結果終於可以了。
轉載:[JS] 可適性週期執行的function
作者 Knuckles(阿德)
標題 [JS] 可適性週期執行的function
時間 2010年04月23日 Fri. PM 06:22:38
雖然js有 setInterval() 可以每隔一段時間執行某個function來更新資料
不過時間設太長的話不夠即時,太短的話又浪費資源
所以想弄個可適性週性執行的方法
讓使用者閒置愈久就愈慢更新
先用 setInterval("idle_time++",1000);
每秒把idle_time的值增加1,來記錄使用者閒置了多久
利用jQuery的事件觸發
$(document).keydown(function(e){ idle_time=0; });
$(document).mouseover(function(e){ idle_time=0; });
來偵測使用者是否有在使用鍵盤或滑鼠
接著我們就可以利用 idle_time 與 setTimeout() 來做可適性週性執行function
利用 setTimeout('autoUpdate()',20000);
當網頁載入後過20秒執行一次 autoUpdate()
(20000ms = 20s)
然後在 autoUpdate() 中這樣寫:
function autoUpdate(){
if(idle_time>=20){ //要閒置20秒才會執行,避免使用者正在操作時自動更新
// 更新資料程式
}
if(idle_time<60 autoupdate="" p="" settimeout=""> else if(idle_time<300 autoupdate="" p="" settimeout=""> else if(idle_time<1200 autoupdate="" p="" settimeout=""> else setTimeout('autoUpdate()',3600000);
}
這樣使用者正在操作時就不會自動更新,而
閒置了20sec~1min時,每20sec執行一次
閒置了1min~5min時,每1min執行一次
閒置了5min~20min時,每5min執行一次
閒置了20min以上時,每小時執行一次
這樣就達到可適性週期執行的效果了
要注意執行 autoUpdate() 最後一定要有 setTimeout() 再把自己執行一次
如果前面設了個 return 跑出去的話,就不會再自動執行了
--
※ 來源: DISP BBS 看板: Knuckles_note 文章連結: http://disp.cc/b/11-1K61200>300>60>
標題 [JS] 可適性週期執行的function
時間 2010年04月23日 Fri. PM 06:22:38
雖然js有 setInterval() 可以每隔一段時間執行某個function來更新資料
不過時間設太長的話不夠即時,太短的話又浪費資源
所以想弄個可適性週性執行的方法
讓使用者閒置愈久就愈慢更新
先用 setInterval("idle_time++",1000);
每秒把idle_time的值增加1,來記錄使用者閒置了多久
利用jQuery的事件觸發
$(document).keydown(function(e){ idle_time=0; });
$(document).mouseover(function(e){ idle_time=0; });
來偵測使用者是否有在使用鍵盤或滑鼠
接著我們就可以利用 idle_time 與 setTimeout() 來做可適性週性執行function
利用 setTimeout('autoUpdate()',20000);
當網頁載入後過20秒執行一次 autoUpdate()
(20000ms = 20s)
然後在 autoUpdate() 中這樣寫:
function autoUpdate(){
if(idle_time>=20){ //要閒置20秒才會執行,避免使用者正在操作時自動更新
// 更新資料程式
}
if(idle_time<60 autoupdate="" p="" settimeout=""> else if(idle_time<300 autoupdate="" p="" settimeout=""> else if(idle_time<1200 autoupdate="" p="" settimeout=""> else setTimeout('autoUpdate()',3600000);
}
這樣使用者正在操作時就不會自動更新,而
閒置了20sec~1min時,每20sec執行一次
閒置了1min~5min時,每1min執行一次
閒置了5min~20min時,每5min執行一次
閒置了20min以上時,每小時執行一次
這樣就達到可適性週期執行的效果了
要注意執行 autoUpdate() 最後一定要有 setTimeout() 再把自己執行一次
如果前面設了個 return 跑出去的話,就不會再自動執行了
--
※ 來源: DISP BBS 看板: Knuckles_note 文章連結: http://disp.cc/b/11-1K61200>300>60>
VisualSVN自動備份
找了一些資料,終於測試出來OK了~^^....快記下來以免忘記。
1.hotcopy方式:(轉載自 http://www.the8m.com/blog/article/chengxua/visualsvnback.html )
simpleBackup.bat要放在svn版本庫的根目錄下。
SVN_backup.bat可隨意放。==============================================
SVN_backup.bat內容:
echo off
rem Subversion的安裝目錄 //如=>"C:\Program Files\VisualSVN Server"
set SVN_HOME="C:\Program Files\VisualSVN Server"
rem 所有版本庫的父目錄 //庫目錄,如=>d:\svn
set SVN_ROOT=C:\Repositories
set SVN_ROOT_RUN="C:\Repositories"
rem 備份的目錄(如:C:\svnbak)
set BACKUP_SVN_ROOT=C:\svnbak
set BACKUP_DIRECTORY=%BACKUP_SVN_ROOT%\%date:~0,4%_%date:~5,2%_%date:~8,2%
if exist %BACKUP_DIRECTORY% goto checkBack
echo 建立備份目錄%BACKUP_DIRECTORY%>>%BACKUP_SVN_ROOT%/backup.log
md %BACKUP_DIRECTORY%
rem 驗證目錄是否為版本庫,如果是則取出名稱備份
for /r %SVN_ROOT% %%I in (.) do @if exist "%%I/conf/svnserve.conf" %SVN_ROOT_RUN%\simplebackup.bat "%%~fI" %%~nI
goto end
:checkBack
echo 備份目錄%BACKUP_DIRECTORY%已經存在,請清空。
goto end:end
=================================================
simpleBackup.bat 內容:
@echo 正在備份版本庫%1......
%SVN_HOME%\bin\svnadmin hotcopy %1 %BACKUP_DIRECTORY%\%2
@echo 版本庫%1成功備份到了%2!==================================================
1.hotcopy方式:(轉載自 http://www.the8m.com/blog/article/chengxua/visualsvnback.html )
simpleBackup.bat要放在svn版本庫的根目錄下。
SVN_backup.bat可隨意放。==============================================
SVN_backup.bat內容:
echo off
rem Subversion的安裝目錄 //如=>"C:\Program Files\VisualSVN Server"
set SVN_HOME="C:\Program Files\VisualSVN Server"
rem 所有版本庫的父目錄 //庫目錄,如=>d:\svn
set SVN_ROOT=C:\Repositories
set SVN_ROOT_RUN="C:\Repositories"
rem 備份的目錄(如:C:\svnbak)
set BACKUP_SVN_ROOT=C:\svnbak
set BACKUP_DIRECTORY=%BACKUP_SVN_ROOT%\%date:~0,4%_%date:~5,2%_%date:~8,2%
if exist %BACKUP_DIRECTORY% goto checkBack
echo 建立備份目錄%BACKUP_DIRECTORY%>>%BACKUP_SVN_ROOT%/backup.log
md %BACKUP_DIRECTORY%
rem 驗證目錄是否為版本庫,如果是則取出名稱備份
for /r %SVN_ROOT% %%I in (.) do @if exist "%%I/conf/svnserve.conf" %SVN_ROOT_RUN%\simplebackup.bat "%%~fI" %%~nI
goto end
:checkBack
echo 備份目錄%BACKUP_DIRECTORY%已經存在,請清空。
goto end:end
=================================================
simpleBackup.bat 內容:
@echo 正在備份版本庫%1......
%SVN_HOME%\bin\svnadmin hotcopy %1 %BACKUP_DIRECTORY%\%2
@echo 版本庫%1成功備份到了%2!==================================================
轉貼:ASP.NET中解决跨子域的Session共享
為了這問題搞了好久,終於找到了解決的資料。
原本找到的資料:http://www.cnblogs.com/assion/archive/2010/07/29/1787960.html
可惜還是無法共享Session的變數,於是又找到一個完全解決的文章,測試結果OK,YA!!!....
網址如下:
http://www.itivy.com/ivy/archive/2011/4/24/634392360221984930.html
不過....還看不太懂:P...先用再說囉...
原本找到的資料:http://www.cnblogs.com/assion/archive/2010/07/29/1787960.html
可惜還是無法共享Session的變數,於是又找到一個完全解決的文章,測試結果OK,YA!!!....
網址如下:
http://www.itivy.com/ivy/archive/2011/4/24/634392360221984930.html
不過....還看不太懂:P...先用再說囉...
IIS 7上出現'vfpoledb.1' 提供者並未登錄於本機電腦上。--解決了
在使用64位元windows 7的IIS時,突然原本可以用的程式出現=>'vfpoledb.1' 提供者並未登錄於本機電腦上。
找了很多資料原來VFPOLEDB不支援64位元....
後來找到一篇"開啟 IIS 7.5 中32位元程式支援 ADODB.Connection"的文章,一試果然可以了....YA...
參考網站:
http://www.eion.com.tw/Blogger/?PID=1074
找了很多資料原來VFPOLEDB不支援64位元....
後來找到一篇"開啟 IIS 7.5 中32位元程式支援 ADODB.Connection"的文章,一試果然可以了....YA...
參考網站:
http://www.eion.com.tw/Blogger/?PID=1074
頁面輸出繁簡中文轉換
心得:
利用VB的功能來做,速度比先前找的方式(比對方式)快多了。
為了偷懶結合修改了2種方式,所以CODE有點亂。....:P
有時間再試試javascript方式。
參考網頁:
http://www.dotblogs.com.tw/jeff377/archive/2008/03/17/1718.aspx
程式碼範例:
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
'''
''' 將繁體中文字轉換成簡體中文。
'''
''' 文字內容。
Public Shared Function Big5ToGb(ByVal Text As String) As String
' 將繁體中文字轉換成簡體中文,LocaleID 設為 2052
Return StrConv(Text, VbStrConv.SimplifiedChinese, 2052)
End Function
'''
利用VB的功能來做,速度比先前找的方式(比對方式)快多了。
為了偷懶結合修改了2種方式,所以CODE有點亂。....:P
有時間再試試javascript方式。
參考網頁:
http://www.dotblogs.com.tw/jeff377/archive/2008/03/17/1718.aspx
程式碼範例:
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
'''
''' 將繁體中文字轉換成簡體中文。
'''
''' 文字內容。
Public Shared Function Big5ToGb(ByVal Text As String) As String
' 將繁體中文字轉換成簡體中文,LocaleID 設為 2052
Return StrConv(Text, VbStrConv.SimplifiedChinese, 2052)
End Function
'''
取得DataPager目前所在頁數的範例程式
備註:
1.DataPagerListView為ListView=>ListViewProductsList使用的DataPager。
2.HiddenFieldCurrentPageNo為存放目前所在頁數。
3.寫在ListViewProductsList的DataBound事件中。
Private Sub ListViewProductsList_DataBound(sender As Object, e As System.EventArgs) Handles ListViewProductsList.DataBound
'
If Me.DataPagerListView.TotalRowCount > 0 Then
Dim CurrentPageNo As Integer = Math.Ceiling(((Me.DataPagerListView.StartRowIndex + Me.DataPagerListView.MaximumRows) / Me.DataPagerListView.MaximumRows))
Me.HiddenFieldCurrentPageNo.Value = CurrentPageNo.ToString
'Me.LabelCurrentPageNo.Text = CurrentPageNo.ToString
Else
'Me.LabelCurrentPageNo.Text = "0"
Me.HiddenFieldCurrentPageNo.Value = "0"
End If
End Sub
1.DataPagerListView為ListView=>ListViewProductsList使用的DataPager。
2.HiddenFieldCurrentPageNo為存放目前所在頁數。
3.寫在ListViewProductsList的DataBound事件中。
Private Sub ListViewProductsList_DataBound(sender As Object, e As System.EventArgs) Handles ListViewProductsList.DataBound
'
If Me.DataPagerListView.TotalRowCount > 0 Then
Dim CurrentPageNo As Integer = Math.Ceiling(((Me.DataPagerListView.StartRowIndex + Me.DataPagerListView.MaximumRows) / Me.DataPagerListView.MaximumRows))
Me.HiddenFieldCurrentPageNo.Value = CurrentPageNo.ToString
'Me.LabelCurrentPageNo.Text = CurrentPageNo.ToString
Else
'Me.LabelCurrentPageNo.Text = "0"
Me.HiddenFieldCurrentPageNo.Value = "0"
End If
End Sub
ASP.Net 的 UTF-8 轉 Big5 及 Big5 轉 UTF-8
ASP.Net 的 UTF-8 轉 Big5 及 Big5 轉 UTF-8 備忘
引用於:
http://www.neo.com.tw/archives/335
http://www.dotblogs.com.tw/topcat/archive/2010/11/04/18807.aspx
引用於:
http://www.neo.com.tw/archives/335
http://www.dotblogs.com.tw/topcat/archive/2010/11/04/18807.aspx
利用 jQuery scrollto 移動至某元素位置 & 應用
目前我是應用在論壇移動至某樓帖子。
需先置入樓層位置的元素,在ListView中放元素HyperLink,如:
<asp:HyperLink ID="HyperLinkFloorNum" runat="server" ClientIDMode="Predictable" NavigateUrl="#">asp:HyperLink>
id的名稱:
ContentPlaceHolder_ListViewForumPost_HyperLinkFloorNum_XX
jQuery scrollto用法:
先引入js
<script src="js/jquery.scrollto.js" type="text/javascript">script>
伺服端語法:
Dim Flr As Integer '接樓層資料
...
Dim FlrIdName As String = "ContentPlaceHolder_ListViewForumPost_HyperLinkFloorNum_" + Flr.ToString
Page.ClientScript.RegisterStartupScript(Me.GetType, "", "$('#" + FlrIdName + "').ScrollTo();", True)
PS.搭配先前文章"DataPager指定跳頁功能"...可以做到直接跳到該樓層的分頁,
'JumpPage(maxPages)
Dim PageNo As Integer = 1
'Try
' PageNo = Integer.Parse(Request("PageNo"))
' If PageNo <= 0 Then
' PageNo = 1
' End If
'Catch ex As Exception
' PageNo = 1
'End Try
'移至樓層
Dim Flr As Integer
Try
Flr = Integer.Parse(Request("Flr"))
PageNo = Int(Flr / 10) + 1
If PageNo > maxPages Then
PageNo = maxPages
End If
Catch ex As Exception
Flr = 0
End Try
Flr = Flr - (PageNo - 1) * 10
Try
If Flr > 0 Then
'
Dim FlrTextBoxName As String = "ContentPlaceHolder_ListViewForumPost_HyperLinkFloorNum_" + Flr.ToString
Page.ClientScript.RegisterStartupScript(Me.GetType, "", "$('#" + FlrTextBoxName + "').ScrollTo();", True)
End If
Catch ex As Exception
'移至最下方
Me.txtBottom.Focus()
End Try
''移至最下方
'Me.txtBottom.Focus()
'移至第X頁
JumpPage(PageNo)
參考:
http://flesler.blogspot.com/2008/02/jqueryserialscroll.html
http://flesler.blogspot.com/2007/10/jquerylocalscroll-10.html
http://flesler.blogspot.com/2007/10/jqueryscrollto.html
http://plugins.jquery.com/project/ScrollTo
DEMO參考:
http://demos.flesler.com/jquery/scrollTo/
DataPager指定跳頁功能
Private Sub JumpPage(ByVal _JumpPage As Integer) 'DataPager指定跳頁功能
'算出指定頁的起始索引值
Dim lowerBand As Integer = (_JumpPage - 1) * Me.DataPager.PageSize
Me.DataPager.SetPageProperties(lowerBand, Me.DataPager.PageSize, True)
End Sub
'算出指定頁的起始索引值
Dim lowerBand As Integer = (_JumpPage - 1) * Me.DataPager.PageSize
Me.DataPager.SetPageProperties(lowerBand, Me.DataPager.PageSize, True)
End Sub
自動產生前台html
http://social.msdn.microsoft.com/forums/zh-TW/236/thread/4eaf6d62-bb64-4886-a916-a63c1b53896f
利用WebRequest.Create
Code Snippet
WebRequest mywebReq ;
WebResponse mywebResp ;
StreamReader sr ;
string strHTML ;
StreamWriter sw;
mywebReq = WebRequest.Create("http://localhost/MyAspNetPage.aspx");
mywebResp = mywebReq.GetResponse();
sr = new StreamReader(mywebResp.GetResponseStream());
strHTML = sr.ReadToEnd();
sw = File.CreateText(Server.MapPath("temp.html"));
sw.WriteLine(strHTML);
sw.Close();
===============================================================
範例:
GeneraterStaticPage.aspx
Code Snippet
GeneraterStaticPage.aspx.cs
Code Snippet
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.IO;
using System.Text;
public partial class GeneraterStaticPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void Button1_Click(object sender, EventArgs e)
{
WebRequest mywebReq;
WebResponse mywebResp;
StreamReader sr;
string strHTML;
StreamWriter sw;
mywebReq = WebRequest.Create(@"http://forums.microsoft.com/MSDN-CHT/ShowPost.aspx?PostID=2008305&SiteID=14");
mywebResp = mywebReq.GetResponse();
sr = new StreamReader(mywebResp.GetResponseStream(),Encoding.UTF8);
strHTML = sr.ReadToEnd();
sw = File.CreateText(Server.MapPath("MyAspNetPage.html")); //產生靜態網頁
sw.WriteLine(strHTML);
sw.Close();
string AlertMsg;
AlertMsg = "產生靜態網頁成功!";
StringBuilder m_Builder = new StringBuilder();
m_Builder.Append(" ");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", m_Builder.ToString());
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("MyAspNetPage.html");
}
}
============================================
參考自 MSDN James Wu文章
利用WebRequest.Create
Code Snippet
WebRequest mywebReq ;
WebResponse mywebResp ;
StreamReader sr ;
string strHTML ;
StreamWriter sw;
mywebReq = WebRequest.Create("http://localhost/MyAspNetPage.aspx");
mywebResp = mywebReq.GetResponse();
sr = new StreamReader(mywebResp.GetResponseStream());
strHTML = sr.ReadToEnd();
sw = File.CreateText(Server.MapPath("temp.html"));
sw.WriteLine(strHTML);
sw.Close();
===============================================================
範例:
GeneraterStaticPage.aspx
Code Snippet
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GeneraterStaticPage.aspx.cs" Inherits="GeneraterStaticPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><FONT< A> color=#4d4c1e>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><FONT< A> color=#4d4c1e>http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>產生靜態網頁並開啟靜態網頁</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="產生靜態網頁" /><br />
<br />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="開啟靜態網頁" /> </div>
</form>
</body>
</html>
GeneraterStaticPage.aspx.cs
Code Snippet
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net;
using System.IO;
using System.Text;
public partial class GeneraterStaticPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
protected void Button1_Click(object sender, EventArgs e)
{
WebRequest mywebReq;
WebResponse mywebResp;
StreamReader sr;
string strHTML;
StreamWriter sw;
mywebReq = WebRequest.Create(@"http://forums.microsoft.com/MSDN-CHT/ShowPost.aspx?PostID=2008305&SiteID=14");
mywebResp = mywebReq.GetResponse();
sr = new StreamReader(mywebResp.GetResponseStream(),Encoding.UTF8);
strHTML = sr.ReadToEnd();
sw = File.CreateText(Server.MapPath("MyAspNetPage.html")); //產生靜態網頁
sw.WriteLine(strHTML);
sw.Close();
string AlertMsg;
AlertMsg = "產生靜態網頁成功!";
StringBuilder m_Builder = new StringBuilder();
m_Builder.Append(" ");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", m_Builder.ToString());
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("MyAspNetPage.html");
}
}
============================================
參考自 MSDN James Wu文章
訂閱:
意見 (Atom)
