<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6196253701031212921</id><updated>2024-09-19T08:22:14.127-07:00</updated><title type='text'>Walt&#39;s 生活札記</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-1138813896934456596</id><published>2011-08-30T22:47:00.000-07:00</published><updated>2011-08-30T22:49:23.420-07:00</updated><title type='text'>[轉載]Android模擬器RAM修改方法</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: Tahoma, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 18px; &quot;&gt;&lt;h2 style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; &quot;&gt;&lt;br /&gt;&lt;/h2&gt;&lt;h2 style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; &quot;&gt;轉載自:&lt;/h2&gt;&lt;h2 style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; &quot;&gt;&lt;a href=&quot;http://www.android123.com.cn/moniqi/806.html&quot;&gt;http://www.android123.com.cn/moniqi/806.html&lt;/a&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2 style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 16px; &quot;&gt;Android模拟器RAM修改方法 - 尤其是3.0&lt;/h2&gt;&lt;div class=&quot;meta&quot; style=&quot;margin-bottom: 3px; padding-bottom: 3px; &quot;&gt;&lt;span class=&quot;tag&quot;&gt;作者: Android开发网原创&lt;/span&gt; &lt;span class=&quot;time&quot;&gt;时间: 2011-03-06&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;   Android模拟器启动速度慢是众所周知的，运行也很缓慢如何加速你的Android Emulator呢? 今天Android123给大家支招了，修改Android模拟器RAM大小，运行流畅度加倍，尤其是3.0 honeycomb这种吃RAM的平板没有真机使用emulator简直是煎熬，官方默认才给分配256MB运行内存，远比Xoom这样的1GB RAM的真机要少很多。&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;   1. 我们以Windows平台的SDK为例，这里Android开发网的模拟器配置路径为 C:\Documents and Settings\&lt;span&gt;android&lt;/span&gt;\.android\avd\&lt;span&gt;android3.avd &lt;/span&gt;，大家注意这个路径中蓝色的android是我的Windows用户名，而红色的android3.avd则是我蜂巢模拟器的名称，我在创建AVD时输入的是android3，具体的大家可以看下图，congfig.ini就是这个模拟器的配置文件:&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;&lt;img border=&quot;0&quot; alt=&quot;android模拟器 内存&quot; width=&quot;591&quot; height=&quot;425&quot; src=&quot;http://www.android123.com.cn/images/android-emulator-ram.jpg&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; border-color: initial; max-width: 100%; display: inline !important; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(230, 245, 164); border-right-color: rgb(230, 245, 164); border-bottom-color: rgb(230, 245, 164); border-left-color: rgb(230, 245, 164); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; &quot; /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;  我们用记事本打开这个ini文件，&lt;strong&gt;当然我们可以看到Unix/Binary的换行符，这里Android123建议你使用UltraEdit或Notepad++打开&lt;/strong&gt;，这里仅作为演示我们大家说下这个文件的结构吧，&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;hw.lcd.density=160 ; 是屏幕的密度&lt;br /&gt;sdcard.size=64M   ;这句代表分配SD卡的大小，我这里仅给了64M&lt;br /&gt;skin.name=WXGA  ;分辨率&lt;br /&gt;skin.path=platforms\android-11\skins\WXGA ;模拟器皮肤&lt;br /&gt;hw.keyboard.lid=no ;是否有物理键盘&lt;br /&gt;vm.heapSize=48  ; 虚拟机默认堆大小&lt;br /&gt;hw.ramSize=256 ; 模拟器的RAM运行内存大小，可以看到这里只有可怜的256MB&lt;br /&gt;image.sysdir.1=platforms\android-11\images\ ; 模拟器的映像文件路径&lt;br /&gt; 这里大家主要是修改hw.ramSize这句，将后面的256换为更大的，当然要根据你PC电脑的物理内存来修改了，否则会严重映像你电脑的性能，如果你电脑的内存是2GB或以上，推荐和摩托Xoom平台的RAM设置的一样大小，hw.ramSize=后面写1024，保存即可，如图&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; &quot;&gt;&lt;img border=&quot;0&quot; alt=&quot;android emulator ram&quot; width=&quot;591&quot; height=&quot;232&quot; src=&quot;http://www.android123.com.cn/images/android-emulator-ram-2.jpg&quot; style=&quot;border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-width: initial; border-color: initial; max-width: 100%; display: inline !important; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(230, 245, 164); border-right-color: rgb(230, 245, 164); border-bottom-color: rgb(230, 245, 164); border-left-color: rgb(230, 245, 164); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; &quot; /&gt;&lt;/p&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/1138813896934456596/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/08/androidram.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1138813896934456596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1138813896934456596'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/08/androidram.html' title='[轉載]Android模擬器RAM修改方法'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-973542224128678653</id><published>2011-08-19T02:26:00.000-07:00</published><updated>2011-08-19T02:29:52.061-07:00</updated><title type='text'>[轉載]Android 對話框(Dialog)大全</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, 宋体; font-size: 14px; line-height: 26px; background-color: rgb(245, 250, 254); &quot;&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;Activities提供了一種方便管理的創建、保存、回复的對話框機制，例如&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;來源:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, 宋体; font-size: 14px; line-height: 26px; background-color: rgb(245, 250, 254); &quot;&gt;&lt;a href=&quot;http://android.tgbus.com/Android/tutorial/201104/348008.shtml&quot;&gt;http://android.tgbus.com/Android/tutorial/201104/348008.shtml&lt;/a&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; line-height: 26px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, 宋体; font-size: 14px; line-height: 26px; background-color: rgb(245, 250, 254); &quot;&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, 宋体; font-size: 14px; line-height: 26px; background-color: rgb(245, 250, 254); &quot;&gt;Activities提供了一種方便管理的創建、保存、回复的對話框機制，例如&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, 宋体; font-size: 14px; line-height: 26px; background-color: rgb(245, 250, 254); &quot;&gt;&lt;span&gt;onCreateDialog(int),onPrepareDialog(int,Dialog),showDialog(int),dismissDialog(int)等方法，如果使用這些方法的話，Activity將通過getOwnerActivity()方法返回該Activity管理的對話框(dialog). &lt;/span&gt;&lt;span&gt;　　onCreateDialog(int):當你使用這個回調函數時，Android系統會有效的設置這個Activity為每個對話框的所有者，從而自動管理每個對話框的狀態並挂靠到Activity上。&lt;/span&gt;&lt;span&gt;這樣，每個對話框繼承這個Activity的特定屬性。&lt;/span&gt;&lt;span&gt;比如，當一個對話框打開時，菜單鍵顯示為這個Activity定義的選項菜單，音量鍵修改Activity使用的音頻流。&lt;/span&gt;&lt;span&gt;　　showDialog(int):當你想要顯示一個對話框時，調用showDialog(intid)方法並傳遞一個唯一標識這個對話框的整數。&lt;/span&gt;&lt;span&gt;當對話框第一次被請求時，Android從你的Activity中調用onCreateDialog(intid)，你應該在這裡初始化這個對話框Dialog。&lt;/span&gt;&lt;span&gt;這個回調方法被傳以和showDialog(intid)相同的ID。&lt;/span&gt;&lt;span&gt;當你創建這個對話框後，在Activity的最後返回這個對象。&lt;/span&gt;&lt;span&gt;　　onPrepareDialog(int,Dialog):在對話框被顯示之前，Android還調用了可選的回調函數onPrepareDialog(intid,Dialog).如果你想在每一次對話框被打開時改變它的任何屬性，你可以定義這個方法。&lt;/span&gt;&lt;span&gt;這個方法在每次打開對話框時被調用，而onCreateDialog(int)僅在對話框第一次打開時被調用。&lt;/span&gt;&lt;span&gt;如果你不定義onPrepareDialog()，那麼這個對話框將保持和上次打開時一樣。&lt;/span&gt;&lt;span&gt;這個方法也被傳遞以對話框的ID，和在onCreateDialog()中創建的對話框對象。&lt;/span&gt;&lt;span&gt;　　dismissDialog(int):當你準備關閉對話框時，你可以通過對這個對話框調用dismiss()來消除它。&lt;/span&gt;&lt;span&gt;如果需要，你還可以從這個Activity中調用dismissDialog(intid)方法，這實際上將為你對這個對話框調用dismiss()方法。&lt;/span&gt;&lt;span&gt;如果你想使用onCreateDialog(intid)方法來管理你對話框的狀態（就如同在前面的章節討論的那樣），然後每次你的對話框消除的時候，這個對話框對象的狀態將由該Activity保留。&lt;/span&gt;&lt;span&gt;如果你決定不再需要這個對像或者清除該狀態是重要的，那麼你應該調用removeDialog(intid)。&lt;/span&gt;&lt;span&gt;這將刪除任何內部對象引用而且如果這個對話框正在顯示，它將被消除。&lt;/span&gt;&lt;span&gt;　　下面是幾種對話框的效果&lt;/span&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;　　圖一：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110431022.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;459&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110431022.jpg&quot; width=&quot;327&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110431022.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110431022.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖二：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110432402.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;456&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110432402.jpg&quot; width=&quot;326&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110432402.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110432402.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖三：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110433791.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;457&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110433791.jpg&quot; width=&quot;327&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110433791.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110433791.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖四：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110451672.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;461&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110451672.jpg&quot; width=&quot;325&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110451672.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110451672.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖五：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110452944.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;460&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110452944.jpg&quot; width=&quot;328&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110452944.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110452944.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖六：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110463144.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;458&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110463144.jpg&quot; width=&quot;328&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110463144.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110463144.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;　　圖七：&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot; style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110464299.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;img height=&quot;481&quot; src=&quot;http://android.tgbus.com/UploadFiles_4504/201104/2011040110464299.jpg&quot; width=&quot;328&quot; border=&quot;0&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; &quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110464299.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;a href=&quot;http://www.tgbus.com/image.html?url=http://android.tgbus.com/UploadFiles_4504/201104/2011040110464299.jpg&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;/a&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖1效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：該效果是當按返回按鈕時彈出一個提示，來確保無誤操作，採用常見的對話框樣式。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;　　代碼：&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;　　創建對話框方法dialog() &lt;/span&gt;&lt;span&gt;　　　　protected void dialog() { &lt;/span&gt;&lt;span&gt;  AlertDialog.Builder builder = new Builder(Main.this); &lt;/span&gt;&lt;span&gt;  builder.setMessage(&quot;確認退出嗎？&quot;); builder.setTitle(&quot;提示&quot;); builder .setPositiveButton(&quot;確認&quot;, new OnClickListener() { @Override &lt;/span&gt;&lt;span&gt;   public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;span&gt;    dialog.dismiss(); Main.this.finish(); &lt;/span&gt;&lt;span&gt;   } &lt;/span&gt;&lt;span&gt;  }); builder.setNegativeButton(&quot;取消&quot; , new OnClickListener() { @Override &lt;/span&gt;&lt;span&gt;   public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;span&gt;    dialog.dismiss(); &lt;/span&gt;&lt;span&gt;   } &lt;/span&gt;&lt;span&gt;  }); builder.create().show();&lt;/span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;在onKeyDown(int keyCode, KeyEvent event)方法中調用此方法&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;public boolean onKeyDown(int keyCode, KeyEvent event) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  if (keyCode == KeyEvent.KEYCODE_BACK &amp;amp;&amp;amp; event.getRepeatCount() == 0) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;   dialog(); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  } &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  return false; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖2效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：改變了對話框的圖表，添加了三個按鈕&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;Dialog dialog = new AlertDialog.Builder(this).setIcon( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     android.R.drawable.btn_star).setTitle(&quot;喜好調查&quot;).setMessage( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     &quot;你喜 ​​歡李連杰的電影嗎？&quot;).setPositiveButton(&quot;很喜歡&quot;, &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new OnClickListener() { @Override &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;      public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;       // TODO Auto-generated method stub &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;       Toast.makeText(Main.this, &quot;我很喜歡他的電影。&quot;, &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;         Toast.LENGTH_LONG).show (); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;      } &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     }).setNegativeButton(&quot;不喜歡&quot;, new OnClickListener() { @Override &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;    public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     // TODO Auto-generated method stub &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     Toast.makeText(Main.this, &quot;我不喜歡他的電影。&quot;, Toast.LENGTH_LONG) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;       .show(); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;    } &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;   }).setNeutralButton(&quot;一般&quot;, new OnClickListener() { @Override &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;    public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     // TODO Auto- generated method stub &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     Toast.makeText(Main.this, &quot;談不上喜歡不喜歡。&quot;, Toast.LENGTH_LONG) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;       .show(); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;    } &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;   }).create(); dialog.show();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;　　&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖3效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：信息內容是一個簡單的View類型&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;new AlertDialog.Builder(this).setTitle(&quot;請輸入&quot;).setIcon( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     android.R.drawable.ic_dialog_info).setView( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new EditText(this)).setPositiveButton(&quot;確定&quot;, null) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     .setNegativeButton(&quot;取消&quot; , null).show();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖4效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：信息內容是一組單選框&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;new AlertDialog.Builder(this).setTitle(&quot;複選框&quot;).setMultiChoiceItems( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new String[] { &quot;Item1&quot;, &quot;Item2&quot; }, null, null) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     .setPositiveButton(&quot;確定&quot;, null) &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     .setNegativeButton(&quot;取消&quot;, null).show();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖5效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：信息內容是一組多選框&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;new AlertDialog.Builder(this).setTitle(&quot;單選框&quot;).setIcon( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     android.R.drawable.ic_dialog_info).setSingleChoiceItems( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new String[] { &quot;Item1&quot;, &quot;Item2&quot; }, 0, &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new DialogInterface.OnClickListener () { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;      public void onClick(DialogInterface dialog, int which) { &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;       dialog.dismiss(); &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;      } &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     }).setNegativeButton(&quot;取消&quot;, null).show();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖6效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：信息內容是一組簡單列表項&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;new AlertDialog.Builder(this).setTitle(&quot;列錶框&quot;).setItems( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     new String[] { &quot;Item1&quot;, &quot;Item2&quot; }, null).setNegativeButton( &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;     &quot;確定&quot;, null).show();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt; &lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;　　&lt;strong&gt;&lt;span&gt;&lt;span&gt;圖7效果&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span&gt;&lt;span&gt;：信息內容是一個自定義的佈局&lt;/span&gt;&lt;span&gt;　　1.佈局文件&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;　　&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?--&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;linearlayout android=&quot; &amp;lt;/font&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;a href=&quot; com=&quot;&quot; apk=&quot;&quot; res=&quot;&quot; target=&quot;_blank&quot; style=&quot;color: rgb(51, 102, 204); font-size: 14px; &quot;&gt;&lt;span&gt;&lt;span&gt;http://schemas.android.com/apk/res/android&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; &quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;android:layout_height=&quot;wrap_content&quot; android:layout_width =&quot;wrap_content&quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;android:background=&quot;#ffffffff&quot; android:orientation=&quot;horizontal&quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;android:id=&quot;@+id/dialog&quot;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;textview layout_height=&quot;wrap_content&quot; font=&quot;&quot;&gt;&lt;/textview&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;   android:layout_width=&quot;wrap_content&quot; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  android:id =&quot;@+id/tvname&quot; android:text=&quot;姓名：&quot; /&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;edittext layout_height=&quot;wrap_content&quot; font=&quot;&quot;&gt;&lt;/edittext&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;  android:layout_width=&quot;wrap_content&quot; android:id=&quot;@+id/etname&quot; android:minWidth=&quot; 100dip&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/linearlayout&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;　　2.調用代碼&lt;/span&gt;&lt;span&gt;　　LayoutInflater inflater = getLayoutInflater(); &lt;/span&gt;&lt;span&gt;   View layout = inflater.inflate(R.layout.dialog, &lt;/span&gt;&lt;span&gt;     (ViewGroup) findViewById(R.id.dialog)); new AlertDialog.Builder(this).setTitle(&quot;自定義佈局&quot;).setView(layout) &lt;/span&gt;&lt;span&gt;     .setPositiveButton(&quot;確定&quot;, null) &lt;/span&gt;&lt;span&gt;     .setNegativeButton(&quot;取消&quot;, null).show();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/973542224128678653/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/08/android-dialog.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/973542224128678653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/973542224128678653'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/08/android-dialog.html' title='[轉載]Android 對話框(Dialog)大全'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-1406112887687772375</id><published>2011-07-22T00:24:00.001-07:00</published><updated>2011-07-22T00:24:55.765-07:00</updated><title type='text'>[android轉載]Intent 用法大公開</title><content type='html'>&lt;a href=&quot;http://ysl-paradise.blogspot.com/2008/12/intent.html&quot;&gt;http://ysl-paradise.blogspot.com/2008/12/intent.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/1406112887687772375/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/07/androidintent.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1406112887687772375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1406112887687772375'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/07/androidintent.html' title='[android轉載]Intent 用法大公開'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-8633661704965667456</id><published>2011-06-29T22:50:00.001-07:00</published><updated>2011-06-29T22:50:48.459-07:00</updated><title type='text'>什麼是除權除息?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana, arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot; border=&quot;0&quot; style=&quot;table-layout: fixed; word-wrap: break-word; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;a03&quot; colspan=&quot;2&quot; align=&quot;left&quot; style=&quot;font-size: 13px; color: rgb(88, 88, 88); line-height: 18px; font-family: verdana, arial; &quot;&gt;&lt;div class=&quot;atk&quot;&gt;【簡單說】：因應發放股票股利或現增而向下調整股價就是除權，因應發放現金股利而向下調整股價就是除息。&lt;br /&gt;&lt;br /&gt;除權或除息的產生係因為投資人在除權或除息日之前與當天購買者，兩者買到的是同一家公司的股票，但是內含的權益不同，顯然相當不公平。因此，必須在除權或除息日當天向下調整股價，成為除權或除息參考價。&lt;br /&gt;&lt;br /&gt;除息參考價&lt;br /&gt;&lt;br /&gt;為使除息前(含現金股利)與除息後所買到的價格一致，公司在發放現金股利時，將股票的價格，按照現金股利，予以同等金額的下降，此為除息參考價。&lt;br /&gt;&lt;br /&gt;除息日申報參考價 = 前一交易日收盤價 －現金股利金額&lt;br /&gt;&lt;br /&gt;例如:A公司決定於8月7日除息，發放現金股利3元。8月6日收盤價為50元，那麼在8月7日的開盤參考價將為(50－3)元，為47元。&lt;br /&gt;&lt;br /&gt;除權參考價的計算&lt;br /&gt;&lt;br /&gt;當公司發放股票股利時，流通在外的股數增多，但發放股票前後，公司整體價值不變，但股數增多了，所以在除權後，每股價值就會下降，成為除權參考價。&lt;br /&gt;&lt;br /&gt;除權參考價=前一交易日該股票收盤價／(1+配股率)&lt;br /&gt;&lt;br /&gt;例如：B公司決定於7月15日發放股票股利五百股(即配股率為50%0。7月&lt;span&gt;&lt;a href=&quot;http://www.ipobar.com/list.php?f=2130&quot; style=&quot;color: blue; text-decoration: underline; &quot;&gt;14&lt;/a&gt;&lt;/span&gt;日的收盤價為150元。那麼在7月15日除權當天的參考價將為(150／1+0.5)=100元&lt;br /&gt;&lt;br /&gt;既除權又除息的參考價計算&lt;br /&gt;&lt;br /&gt;現在很多公司在發放股利時，會採取配股加配息的方式。其參考價的計算方法為：&lt;br /&gt;&lt;br /&gt;除權又除息參考價=(前一交易日該股票收盤價－現金股利金額)／(1+配股率)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;轉載自:&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.ipobar.com/read.php?tid-68746.html#this&quot;&gt;http://www.ipobar.com/read.php?tid-68746.html#this&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/8633661704965667456/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/06/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/8633661704965667456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/8633661704965667456'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/06/blog-post.html' title='什麼是除權除息?'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-5665885981355589138</id><published>2011-06-15T19:43:00.000-07:00</published><updated>2011-06-15T20:00:32.680-07:00</updated><title type='text'>期末考-android client server</title><content type='html'>&lt;div&gt;&lt;div&gt;import java.io.BufferedInputStream;&lt;/div&gt;&lt;div&gt;import java.io.BufferedOutputStream;&lt;/div&gt;&lt;div&gt;import java.io.IOException;&lt;/div&gt;&lt;div&gt;import java.net.ServerSocket;&lt;/div&gt;&lt;div&gt;import java.net.Socket;&lt;/div&gt;&lt;div&gt;public class tcpserver {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;/**&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt; * @param args&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt; */&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;// TODO Auto-generated method stub&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;byte[] data = new byte[1024];&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;int temp;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;ServerSocket server0 = new ServerSocket(3334);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Socket socket = server0.accept();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;while((temp = bin.read())!= -1){&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;System.out.print((char)temp);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bin.close();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;server0.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;try {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;ServerSocket server1 = new ServerSocket(3335);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Socket socket = server1.accept();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;BufferedInputStream bin = new BufferedInputStream(socket.getInputStream());&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;while((temp = bin.read())!= -1){&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;System.out.print((char)temp);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bin.close();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;server1.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;===============================================================&lt;/div&gt;&lt;div&gt;以上這邊是Server的程式部分,基本上與上課的大同小異,重點在於要在建立起一個新的Port 讓Client能夠同時連線...所以直接把中間那段,再見port的程式複製之後貼在下面,把port改3335,Server的部分就完成了...&lt;/div&gt;&lt;div&gt;===============================================================&lt;/div&gt;&lt;div&gt;至於Client的部分,也是利用上課的範例,把資料夾名稱改掉,再把專案載入進來,這樣就有兩個client的專案,一樣把第二個專案連結port的地方改掉,再把要輸出的字也改掉,就完成了..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;=========================&lt;/div&gt;&lt;div&gt;&lt;div&gt;package tw.brad.tcpclient;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import java.io.BufferedOutputStream;&lt;/div&gt;&lt;div&gt;import java.io.IOException;&lt;/div&gt;&lt;div&gt;import java.net.Socket;&lt;/div&gt;&lt;div&gt;import java.net.UnknownHostException;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import android.app.Activity;&lt;/div&gt;&lt;div&gt;import android.os.Bundle;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class tcpclient extends Activity {&lt;/div&gt;&lt;div&gt;    @Override&lt;/div&gt;&lt;div&gt;    public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;&lt;div&gt;        super.onCreate(savedInstanceState);&lt;/div&gt;&lt;div&gt;        setContentView(R.layout.main);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        byte[] buffer = &quot;This is client1&quot;.getBytes();&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        try {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Socket socket = new Socket(&quot;10.0.2.2&quot;, 3334);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;BufferedOutputStream bout = &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;new BufferedOutputStream(socket.getOutputStream());&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.write(buffer);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.flush();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;socket.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (UnknownHostException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;==========================&lt;/div&gt;&lt;div&gt;以上為client1&lt;/div&gt;&lt;div&gt;==========================&lt;/div&gt;&lt;div&gt;&lt;div&gt;package tw.brad.tcpclient;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import java.io.BufferedOutputStream;&lt;/div&gt;&lt;div&gt;import java.io.IOException;&lt;/div&gt;&lt;div&gt;import java.net.Socket;&lt;/div&gt;&lt;div&gt;import java.net.UnknownHostException;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;import android.app.Activity;&lt;/div&gt;&lt;div&gt;import android.os.Bundle;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;public class tcpclient extends Activity {&lt;/div&gt;&lt;div&gt;    @Override&lt;/div&gt;&lt;div&gt;    public void onCreate(Bundle savedInstanceState) {&lt;/div&gt;&lt;div&gt;        super.onCreate(savedInstanceState);&lt;/div&gt;&lt;div&gt;        setContentView(R.layout.main);&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        byte[] buffer = &quot;\n This is client2&quot;.getBytes();&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        try {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;Socket socket = new Socket(&quot;10.0.2.2&quot;, 3335);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;BufferedOutputStream bout = &lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;    &lt;/span&gt;new BufferedOutputStream(socket.getOutputStream());&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.write(buffer);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.flush();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;bout.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;socket.close();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (UnknownHostException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;} catch (IOException e) {&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;// TODO Auto-generated catch block&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;   &lt;/span&gt;e.printStackTrace();&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;====================&lt;/div&gt;&lt;div&gt;以上為Client2&lt;/div&gt;&lt;div&gt;====================&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/5665885981355589138/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/06/android-client-server.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/5665885981355589138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/5665885981355589138'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/06/android-client-server.html' title='期末考-android client server'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-6199000439094687024</id><published>2011-05-22T12:12:00.000-07:00</published><updated>2011-05-22T12:14:17.498-07:00</updated><title type='text'>[轉載] 8款開放原始碼的Android遊戲引擎</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(90, 90, 90); font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; &quot;&gt;以下介紹的8款開源的Android遊戲引擎，OSChina 都已收錄。&lt;br /&gt;&lt;br /&gt;很多初學Android遊戲開發的朋友，往往會顯得有些無所適從，他們常常不知道該從何處入手，每當遇到自己無法解決的難題時，又往往會一邊羨慕於iPhone下有諸如Cocos2d-iphone之類的免費遊戲引擎可供使用，一邊自暴自棄的抱怨Android平台遊戲開發難度太高，又連個像樣的遊戲引擎也沒有，甚至誤以為使用Java語言開發遊戲是一件費力不討好且沒有出路的事情。&lt;br /&gt;&lt;br /&gt;事實上，這種想法完全是沒有必要且不符合實際的，作為能和蘋果iOS分庭抗禮的Android（各種意義上），當然也會有相當數量的遊戲引擎存在。僅僅因為我們處於這個狹小的天地間，與外界接觸不夠，所以對它們的存在茫然不知罷了。&lt;br /&gt;&lt;br /&gt;下面我就羅列出八款常見的Android遊戲引擎，以供有需要者參考（收費，下載量過小，不公佈源碼，以及鄙人不知道（-_-）的引擎不在此列）。&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;a name=&quot;more&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;1、Angle &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Angle是一款專為Android平台設計的，敏捷且適合快速開發的2D遊戲引擎，基於OpenGL ES技術開發。 該引擎全部用Java代碼編寫，並且可以根據自己的需要替換裡面的實現，缺陷在於文檔不足，而且下載的代碼中僅僅包含有少量的示例教程。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求不詳。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/angle/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/angle/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;2、Rokon &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;rokon是一款Android 2D遊戲引擎，基於OpenGL ES技術開發，物理引擎為Box2D，因此能夠實現一些較為複雜的物理效果，該項目最新版本為2.0.3 (09/07/10)。 總體來說，此引擎最大的優點在於其開發文檔相當之完備，並且項目作者對反饋Bug的修正非常之神速，所以該框架的使用在目前也最為廣泛，有人乾脆將它稱為Cocos2d-iPhone引擎的Android版（業務邏輯和編碼風格上也確實很像）。 附帶一提，國內某個需要註冊會員才能下載的Android遊戲框架衍生於此框架，所以大家也不要刻板的認為收費便一定是好的，免費就一定不好。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求為Android 1.5。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/rokon/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/rokon/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;3、LGame &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;LGame是一款國人開發的Java遊戲引擎，有Android及PC(J2SE)兩個開發版本，目前最高版本同為0.2.6(31/07/10)。 其底層繪圖器LGrpaphics封裝有J2SE以及J2ME提供的全部Graphics API（PC版採用Graphics2D封裝，Android版採用Canvas模擬實現），所以能夠將J2SE或J2ME開發經驗直接套用其中，兩版本間主要代碼能夠相互移植。 Android版內置有Admob接口，可以不必配置XML直接硬編碼Admob廣告信息。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;該引擎除了基本的音效、圖形、物理、精靈等常用組件以外，也內置有Ioc、xml、http等常用Java組件的封裝，代價是jar體積較為龐大，PC版已突破1.2MB，Android版有所簡化也在500KB左右。 此外，該引擎還內置有按照1:1實現的J2ME精靈類及相關組件，可以將絕大多數J2ME遊戲平移到Android或PC版中。 唯一遺憾的是，該項目作者是個極其懶惰的傢伙，開發文檔從去年說到今年依舊沒有提供，只有遊戲示例可供下載。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求為Android 1.1。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/loon-simple/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/loon-simple/ &lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;4、AndEngine &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;andengine同樣是一款基於OpenGL ES技術的Android遊戲引擎，物理引擎同樣為Box2D（標配|||）。 該框架性能普通，文檔缺乏，但示例較為豐富。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;下載地址（未直接提供jar下載，源碼可通過svn提取）：&lt;a href=&quot;http://code.google.com/p/andengine/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/andengine/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求不詳。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://www.andengine.org/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://www.andengine.org/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;5、libgdx &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;libgdx是一款基於OpenGL ES技術開發的Android遊戲引擎，支持Android平台下的2D遊戲開發，物理引擎採用Box2D實現。 單就性能角度來說，堪稱是一款非常強大的Android遊戲引擎，但缺陷在於精靈類等相關組件在使用上不夠簡化，而且文檔也較為匱乏。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求不詳。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/libgdx/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/libgdx/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;6、jPCT &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jPCT是一款基於OpenGL技術開發的3D圖形引擎(PC環境為標準OpenGL，Android為OpenGL ES)， 以Java語言為基礎的，擁有功能強大的Java 3D解決方案。 該引擎與LGame（此為2D遊戲引擎）相類似，目前擁有PC(J2SE)以及Android兩個開發版本。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;jPCT的最大優勢之一，就在於它驚人的向下兼容性。 在PC環境中，jPCT甚至可以運行在JVM1.1環境之中，因為jPCT內部提供的圖形渲染接口完全符合所有的Java 1.1規範（就連已經消失的Microsoft VM乃至更古老的Netscape 4 VM也不例外）。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求為Android 1.5。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://www.jpct.net/jpct-ae/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://www.jpct.net/jpct-ae/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;7、Alien3d&lt;/b&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Alien3d是一款體積非常之小的Android 3D遊戲引擎，基於OpenGL ES技術開發。 為了壓縮體積，它根據不同功能採用多jar方式發布（包括alien3d-engine.jar，alien3d- tiled.jar，alien3d-sprites.jar，alien3d-shapes.jar，alien3d- particles2d.jar，），事實上它的核心文件大約只有40KB，所有相關jar的總和也不足150KB。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求為Android 1.5。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/alien3d/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/alien3d/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;8、Catcake &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Catcake是一款跨平台的Java 3D圖形引擎，目前支持PC(J2SE)及Android環境運行（已有iPhone版規劃）。 該引擎在易用性和運行性能上皆有出色的表現，支持常見的遊戲開發功能，諸如精靈動畫，音頻處理和視頻播放等。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;最低運行環境要求為Android 1.6。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;項目地址：&lt;a href=&quot;http://code.google.com/p/catcake/&quot; style=&quot;text-decoration: none; color: rgb(60, 216, 108); &quot;&gt;http://code.google.com/p/catcake/&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;轉載自:&lt;a href=&quot;http://waineko.blogspot.com/2010/09/8android.html&quot;&gt;http://waineko.blogspot.com/2010/09/8android.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/6199000439094687024/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/05/8android.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/6199000439094687024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/6199000439094687024'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/05/8android.html' title='[轉載] 8款開放原始碼的Android遊戲引擎'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-7676012627896622821</id><published>2011-05-11T00:13:00.000-07:00</published><updated>2011-05-11T02:37:21.396-07:00</updated><title type='text'>網路核心程式設計-Week11-Homework</title><content type='html'>&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;1.在blog 說明 Class InetAddress  的用法,以程式舉例&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; &quot;&gt;&lt;p style=&quot;line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 18px; color: rgb(0, 0, 0); &quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: small; font-family: &#39;Times New Roman&#39;; line-height: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;此類別表示網際網路協議 (IP) 位址。&lt;/span&gt;IP 位址是 IP 使用的 32 位或 128 位無符號數字，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: small; font-family: &#39;Times New Roman&#39;; line-height: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;它是一種低層級協議，UDP 和 TCP 協議都是在它的基礎上建構的。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: small; font-family: &#39;Times New Roman&#39;; line-height: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;InetAddress 的實例包含 IP 位址，還可能包含相應的主機名（取決於它是否用主機名建構或者是否已執行反向主機名解析）。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;font-size: small; font-family: &#39;Times New Roman&#39;; line-height: normal; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-family: Tahoma, Verdana; font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; &quot;&gt;import java.net.*;&lt;br /&gt;class GetIP {&lt;br /&gt;public static void main(String[] args)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;try{&lt;br /&gt;InetAddress IP_Address = InetAddress.getByName(&quot;www.kimo.com.tw&quot;);&lt;br /&gt;System.out.println(IP_Address);&lt;br /&gt;}catch (UnknownHostException e){&lt;br /&gt;System.out.println(&quot;找不到 www.kimo.com.tw 位址&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;編譯與執行&lt;br /&gt;&lt;br /&gt;javac GetIP.java&lt;br /&gt;&lt;br /&gt;java GetIP&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;&quot;&gt;資料參考:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; font-size: 12px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;1.&lt;a href=&quot;http://www.138vipbbs.com/vipccb/ccb/topic_view.cgi?forum=7&amp;amp;article_id=0107051121211619&amp;amp;publishtime_id=0107051121211619&amp;amp;class=1&amp;amp;new_window=1&quot;&gt;http://www.138vipbbs.com/vipccb/ccb/topic_view.cgi?forum=7&amp;amp;article_id=0107051121211619&amp;amp;publishtime_id=0107051121211619&amp;amp;class=1&amp;amp;new_window=1&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;2.說明FTP client/server 程式與FTP通訊協定 &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(68, 68, 68); font-family: Arial, Verdana, sans-serif; line-height: 20px; &quot;&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;==============================================================&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;//Ftp  Client&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;import java.io.*;&lt;br /&gt;import java.net.*;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;public class Client13_4 {&lt;br /&gt; int i;&lt;br /&gt; static String iaddr;&lt;br /&gt; static int port;&lt;br /&gt; static String infilename;&lt;br /&gt;&lt;br /&gt; public Client13_4() {&lt;br /&gt;    try{&lt;br /&gt;        Socket socket=new Socket(InetAddress.getByName(iaddr),port);&lt;br /&gt;        DataOutputStream outstream = new DataOutputStream(socket.getOutputStream());&lt;br /&gt;&lt;br /&gt;        FileInputStream fis = new FileInputStream(infilename);&lt;br /&gt;        while((i=fis.read()) !=-1)&lt;br /&gt;             outstream.writeInt(i);&lt;br /&gt;        outstream.writeInt(i);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;         System.out.println(&quot;Data sent to internet successfully!&quot;);&lt;br /&gt;        socket.close();&lt;br /&gt;     }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;      catch(IOException e){&lt;br /&gt;        System.out.println(e.getMessage());&lt;br /&gt;     }&lt;br /&gt; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;  public static void main(String args[]) {&lt;br /&gt;     if (args.length &amp;lt; 3){&lt;br /&gt;        System.out.println(&quot;USAGE: java Client13_4 [iaddr] [port] [infilename]&quot;);&lt;br /&gt;        System.exit(1);&lt;br /&gt;     }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;      iaddr = args[0];&lt;br /&gt;     port=Integer.parseInt(args[1]);&lt;br /&gt;     infilename = args[2];&lt;br /&gt;     Client13_4 ClientStart=new Client13_4();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;==============================================================&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;//FTP server&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;import java.net.*;&lt;br /&gt;import java.io.*;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;public class Server13_4 {&lt;br /&gt; int messagein;&lt;br /&gt; static int port;&lt;br /&gt; static String outfilename;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;  public Server13_4() {&lt;br /&gt;    try{&lt;br /&gt;        ServerSocket SS = new ServerSocket(port);&lt;br /&gt;        System.out.println(&quot;Server is created and waiting Client to connect...&quot;);&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;         Socket socket = SS.accept();&lt;br /&gt;        System.out.println(&quot;Client IP = &quot; +&lt;br /&gt;                            socket.getInetAddress().getHostAddress());&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;         DataInputStream instream = new DataInputStream(socket.getInputStream());&lt;br /&gt;        FileOutputStream fos = new FileOutputStream(outfilename);&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;         while(messagein != -1){&lt;br /&gt;             messagein = instream.readInt();   &lt;br /&gt;             fos.write(messagein);&lt;br /&gt;         }&lt;br /&gt;        System.out.println(&quot;Data written to File successfully!&quot;);&lt;br /&gt;     }&lt;br /&gt;     catch(IOException e){&lt;br /&gt;         System.out.println(e.getMessage());&lt;br /&gt;     }&lt;br /&gt; }&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;  public static void main(String args[]){&lt;br /&gt;        if(args.length &amp;lt; 2){&lt;br /&gt;           System.out.println(&quot;Usage: java Server13_4 [port] [outfilename]&quot;);&lt;br /&gt;           System.exit(1);&lt;br /&gt;        }&lt;br /&gt;        port=Integer.parseInt(args[0]);&lt;br /&gt;        outfilename = args[1];&lt;br /&gt;        Server13_4 ServerStart=new Server13_4();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;span style=&quot;color: black; line-height: normal; font-family: Arial; &quot;&gt;==============================================================&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt; &lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;color: rgb(102, 102, 102); line-height: 18px; font-family: arial; &quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; line-height: 22px; color: rgb(0, 0, 0); font-family: sans-serif; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;&lt;b&gt;檔案傳輸協定&lt;/b&gt;（&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E8%8B%B1%E6%96%87&quot; class=&quot;mw-redirect&quot; title=&quot;英文&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;英文&lt;/a&gt;：&lt;b&gt;File Transfer Protocol&lt;/b&gt;，簡稱為&lt;b&gt;FTP&lt;/b&gt;）是用於在&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E7%B6%B2%E7%B5%A1&quot; class=&quot;mw-redirect&quot; title=&quot;網路&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;網路&lt;/a&gt;上進行檔案傳輸的一套標準協議。它屬於&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E4%BC%A0%E8%BE%93%E5%8D%8F%E8%AE%AE&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;網路傳輸協定&lt;/a&gt;的&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%BA%94%E7%94%A8%E5%B1%82&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;應用層&lt;/a&gt;。&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;FTP是一個8位元的用戶端-伺服器協定，能操作任何型別的檔案而不需要進一步處理，就像MIME或Unicode一樣。但是，FTP有著極高的延時，這意味著，從開始請求到第一次接收需求資料之間的時間，會非常長；並且不時的必須執行一些冗長的登陸行程。&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;3. 何為 url, 什麼是 Domain Name System&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; line-height: 22px; color: rgb(0, 0, 0); font-family: sans-serif; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;b&gt;統一資源定位符&lt;/b&gt;（URL，英語 Uniform / Universal Resource Locator 的縮寫）也被稱為&lt;b&gt;網頁位址&lt;/b&gt;，是&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%9B%A0%E7%89%B9%E7%BD%91&quot; class=&quot;mw-redirect&quot; title=&quot;網際網路&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;網際網路&lt;/a&gt;上標準的資源的位址（&lt;span lang=&quot;en&quot;&gt;Address&lt;/span&gt;)。它最初是由&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E8%92%82%E5%A7%86%C2%B7%E4%BC%AF%E7%BA%B3%E6%96%AF-%E6%9D%8E&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;蒂姆·伯納斯-李&lt;/a&gt;發明用來作為&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E4%B8%87%E7%BB%B4%E7%BD%91&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;全球資訊網&lt;/a&gt;的位址的。現在它已經被&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E4%B8%87%E7%BB%B4%E7%BD%91%E8%81%94%E7%9B%9F&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;全球資訊網協會&lt;/a&gt;編製為網際網路標準RFC1738了。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; line-height: 22px; color: rgb(0, 0, 0); font-family: sans-serif; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 15px; line-height: 22px; color: rgb(0, 0, 0); font-family: sans-serif; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; &quot;&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;&lt;b&gt;網域名稱系統&lt;/b&gt;（&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E8%8B%B1%E8%AF%AD&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;英語&lt;/a&gt;：&lt;span lang=&quot;en&quot;&gt;Domain Name System&lt;/span&gt;，縮寫DNS）是&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%9B%A0%E7%89%B9%E7%BD%91&quot; class=&quot;mw-redirect&quot; title=&quot;網際網路&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;網際網路&lt;/a&gt;的一項核心服務，它作為可以將&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;域名&lt;/a&gt;和&lt;a href=&quot;http://zh.wikipedia.org/wiki/IP%E5%9C%B0%E5%9D%80&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;IP位址&lt;/a&gt;相互&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E6%98%A0%E5%B0%84&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;對映&lt;/a&gt;的一個&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E6%95%B0%E6%8D%AE%E5%BA%93&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;分散式資料庫&lt;/a&gt;，能夠使人更方便的存取&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E4%BA%92%E8%81%94%E7%BD%91&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;網際網路&lt;/a&gt;，而不用去記住能夠被機器直接讀取的IP數串。&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;DNS 使用&lt;a href=&quot;http://zh.wikipedia.org/wiki/TCP&quot; class=&quot;mw-redirect&quot; title=&quot;TCP&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;TCP&lt;/a&gt;和&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E7%94%A8%E6%88%B7%E6%95%B0%E6%8D%AE%E6%8A%A5%E5%8D%8F%E8%AE%AE&quot; title=&quot;使用者資料報協定&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;UDP&lt;/a&gt;&lt;a href=&quot;http://zh.wikipedia.org/wiki/%E7%AB%AF%E5%8F%A3&quot; class=&quot;mw-redirect&quot; title=&quot;埠&quot; style=&quot;text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; &quot;&gt;埠&lt;/a&gt;53。&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; &quot;&gt;資料來源:維基百科&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;4. window 之 localhost 如何設定 &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Sans&#39;, verdana, Arial; font-size: 14px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: normal; &quot;&gt;建議修改C:\windows\system32\drivers\etc\hosts 檔案，加上自訂的伺服器名稱跟127.0.0.1的對應，這樣你在網址列輸入自訂的伺服器名稱時，它就會到127.0.0.1，也就是localhost，然後apache的虛擬伺服器就會接手處理。&lt;br /&gt;&lt;br /&gt;利用這個方法，就可以在本地模擬多個網址。&lt;br /&gt;&lt;br /&gt;舉例來說，hosts裡面有一條localhost1 127.0.0.1，然後虛擬伺服器設定裡面的ServerName有localhost1，打在瀏覽器網址列打http://localhost1，應該就可以連到你設定的虛擬伺服器。&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;line-height: 18px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; font-size: medium; font-family: arial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Lucida Sans&#39;, verdana, Arial; font-size: 14px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; line-height: normal; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 14px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;資料來源:&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.programmer-club.com.tw/showSameTitleN/php/9217.html&quot;&gt;http://www.programmer-club.com.tw/showSameTitleN/php/9217.html&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/7676012627896622821/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/05/week11-homework.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/7676012627896622821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/7676012627896622821'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/05/week11-homework.html' title='網路核心程式設計-Week11-Homework'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-8282883664126024351</id><published>2011-04-17T12:02:00.000-07:00</published><updated>2011-04-17T12:03:22.920-07:00</updated><title type='text'>好站連結－程式設計工藝大師</title><content type='html'>&lt;a href=&quot;http://tccnchsu.blogspot.com/&quot;&gt;http://tccnchsu.blogspot.com/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/8282883664126024351/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/04/blog-post_17.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/8282883664126024351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/8282883664126024351'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/04/blog-post_17.html' title='好站連結－程式設計工藝大師'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-367522900470177787</id><published>2011-04-13T00:30:00.000-07:00</published><updated>2011-04-13T01:26:11.025-07:00</updated><title type='text'>網路核心程式設計-期中考</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7sTGcHR6wIrKYqwgQWUP0hoS4lHnHgLWh19CLy8a4FQJgR-Je2qTvAq8QesL-gGX88iDehvXQU3ULe1RhTTHRA30VssIT2hQk6G0MY7DlFZRJLmYcaPci6tVdQBDcw0u8XcoXWz5gva0/s1600/gcc_x1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRoqyc-9PlSI6S7LLNepuaV3XZNMXFAYPs05_B0ipFQNbJj7uydFkuX6qxWz1Qt2bEyYt6-ozQwnUhc56ive_JK3-vwa9vJQEt_c5JmKXyOh6MebukW0JqussrqHr6RVJuhXvsjcf_qWw/s1600/gcc_x3.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;1.用Linux+Gcc跟The world say hello&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; color: rgb(0, 0, 0); line-height: normal; &quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; color: rgb(0, 0, 0); line-height: normal; &quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4vNMjrQddTQoagquDJyTMS6IRDTBceBX7a5OWk8Tb32bBDbOo_Qtzo6ID0-qsSLBk_T5O7KUA_FhLnHA2zHWgvH97azaouoMElQxGEgqWU9BZdSDXY9Gb72LOf_gb82SdH9Mrzl-kPQ/s1600/gcc_1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4vNMjrQddTQoagquDJyTMS6IRDTBceBX7a5OWk8Tb32bBDbOo_Qtzo6ID0-qsSLBk_T5O7KUA_FhLnHA2zHWgvH97azaouoMElQxGEgqWU9BZdSDXY9Gb72LOf_gb82SdH9Mrzl-kPQ/s320/gcc_1.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594978552505420722&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 229px; &quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8j95ViGQ1pLglsJ250CihvXVm8ArFzk1JBRUGgVlV7vOVvrug8Le-uAXE7m4tvJ2GoOW-hvd-JMZzfmSVk9SVCrJ8ark8tdKt1-8zEOBsBetgqzAScCUfpEk_zsTHgQimp5o_p5L4wrM/s1600/gcc_2.png&quot; style=&quot;color: rgb(0, 0, 0); font-family: Georgia, serif; font-size: 16px; line-height: normal; &quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8j95ViGQ1pLglsJ250CihvXVm8ArFzk1JBRUGgVlV7vOVvrug8Le-uAXE7m4tvJ2GoOW-hvd-JMZzfmSVk9SVCrJ8ark8tdKt1-8zEOBsBetgqzAScCUfpEk_zsTHgQimp5o_p5L4wrM/s320/gcc_2.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594978556765103490&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 172px; &quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4vNMjrQddTQoagquDJyTMS6IRDTBceBX7a5OWk8Tb32bBDbOo_Qtzo6ID0-qsSLBk_T5O7KUA_FhLnHA2zHWgvH97azaouoMElQxGEgqWU9BZdSDXY9Gb72LOf_gb82SdH9Mrzl-kPQ/s1600/gcc_1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQqlfUN31_wwDzW3qr1r0fsnNFiDAHhYAMDg776ytdkzNR9RcXt1USEiUNsDClxp7axQdPJLAHQkqIqP5GOjb19hOHNemu6kIfMkqv88ayn087HcMtZeH9FSv82sQbBD7au_Sik6Qybvo/s1600/gcc_3.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 229px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQqlfUN31_wwDzW3qr1r0fsnNFiDAHhYAMDg776ytdkzNR9RcXt1USEiUNsDClxp7axQdPJLAHQkqIqP5GOjb19hOHNemu6kIfMkqv88ayn087HcMtZeH9FSv82sQbBD7au_Sik6Qybvo/s320/gcc_3.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594978557393280418&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8j95ViGQ1pLglsJ250CihvXVm8ArFzk1JBRUGgVlV7vOVvrug8Le-uAXE7m4tvJ2GoOW-hvd-JMZzfmSVk9SVCrJ8ark8tdKt1-8zEOBsBetgqzAScCUfpEk_zsTHgQimp5o_p5L4wrM/s1600/gcc_2.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;2.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;Linux 編譯 gcc 執行 client / server&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 238); font-family: Georgia, serif; font-size: 16px; -webkit-text-decorations-in-effect: underline; line-height: normal; &quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7sTGcHR6wIrKYqwgQWUP0hoS4lHnHgLWh19CLy8a4FQJgR-Je2qTvAq8QesL-gGX88iDehvXQU3ULe1RhTTHRA30VssIT2hQk6G0MY7DlFZRJLmYcaPci6tVdQBDcw0u8XcoXWz5gva0/s320/gcc_x1.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594981543172547058&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 162px; &quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 238); font-family: Georgia, serif; font-size: 16px; -webkit-text-decorations-in-effect: underline; line-height: normal; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; color: rgb(0, 0, 0); line-height: normal; &quot;&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Georgia, serif; font-size: 16px; color: rgb(0, 0, 0); line-height: normal; &quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUWo17CDnSGYiUFjx_sZ52LKcUJdg7bDam9Xv5KUs2eSDCdGlrYy-QGzSsgxeif1hxtpLwc3QGmzwgkXlBw-IvSNXiPeNf0O7AujIxsJyWXsgdoVhHY4ezcEAI_tLd79anUbdUs6QArWE/s1600/gcc_x2.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUWo17CDnSGYiUFjx_sZ52LKcUJdg7bDam9Xv5KUs2eSDCdGlrYy-QGzSsgxeif1hxtpLwc3QGmzwgkXlBw-IvSNXiPeNf0O7AujIxsJyWXsgdoVhHY4ezcEAI_tLd79anUbdUs6QArWE/s320/gcc_x2.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594980167256225810&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 165px; &quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtwq8LkX5Q5L4uCHsvva4oVZf8h19WRUlo5OsxA0fQ8Pz6tYOdGfn2mPMi1CmuUBl9ynV-Iu0qPQb-tDnK3jGoON5RFkmm3uuQI9w95CGE9m4JbVlTWipf-8I4Asd5-wb4mw1jxRkI6jA/s1600/gcc_x1.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRoqyc-9PlSI6S7LLNepuaV3XZNMXFAYPs05_B0ipFQNbJj7uydFkuX6qxWz1Qt2bEyYt6-ozQwnUhc56ive_JK3-vwa9vJQEt_c5JmKXyOh6MebukW0JqussrqHr6RVJuhXvsjcf_qWw/s1600/gcc_x3.png&quot; style=&quot;color: rgb(0, 0, 0); font-family: Georgia, serif; font-size: 16px; line-height: normal; &quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRoqyc-9PlSI6S7LLNepuaV3XZNMXFAYPs05_B0ipFQNbJj7uydFkuX6qxWz1Qt2bEyYt6-ozQwnUhc56ive_JK3-vwa9vJQEt_c5JmKXyOh6MebukW0JqussrqHr6RVJuhXvsjcf_qWw/s320/gcc_x3.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5594980172486504194&quot; style=&quot;display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 320px; height: 244px; &quot; /&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; &gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUWo17CDnSGYiUFjx_sZ52LKcUJdg7bDam9Xv5KUs2eSDCdGlrYy-QGzSsgxeif1hxtpLwc3QGmzwgkXlBw-IvSNXiPeNf0O7AujIxsJyWXsgdoVhHY4ezcEAI_tLd79anUbdUs6QArWE/s1600/gcc_x2.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 12px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(102, 102, 102); font-family: arial; font-size: 12px; line-height: 18px; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/367522900470177787/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/04/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/367522900470177787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/367522900470177787'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/04/blog-post.html' title='網路核心程式設計-期中考'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc4vNMjrQddTQoagquDJyTMS6IRDTBceBX7a5OWk8Tb32bBDbOo_Qtzo6ID0-qsSLBk_T5O7KUA_FhLnHA2zHWgvH97azaouoMElQxGEgqWU9BZdSDXY9Gb72LOf_gb82SdH9Mrzl-kPQ/s72-c/gcc_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-2269700716006270552</id><published>2011-03-30T03:19:00.000-07:00</published><updated>2011-03-30T03:26:03.561-07:00</updated><title type='text'>網路核心程式設計-Week6-雙winsock接收通訊</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTn8SwFFl-MJzY2Y7i1bLvbwcd352x0G4T0xx98eJtwsPtuDqKVgt2NV8BQ2v2jzNkBqOhyEdzE7uzb_ShnETezfnxR1UOlhOuMsEEwWEi6E9KbocjKZJa7S7lFElrsse9JuvViaagd-c/s1600/QQ%25E6%2588%25AA%25E5%259C%2596%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 271px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTn8SwFFl-MJzY2Y7i1bLvbwcd352x0G4T0xx98eJtwsPtuDqKVgt2NV8BQ2v2jzNkBqOhyEdzE7uzb_ShnETezfnxR1UOlhOuMsEEwWEi6E9KbocjKZJa7S7lFElrsse9JuvViaagd-c/s320/QQ%25E6%2588%25AA%25E5%259C%2596%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5589817253325013378&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Dim state, check As Integer&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command1_Click()&lt;/div&gt;&lt;div&gt;If Winsock1.state = 0 Then&lt;/div&gt;&lt;div&gt;Winsock1.Bind Winsock1.LocalPort, Winsock1.LocalIP&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Label3.Caption = Winsock1.state&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command2_Click()&lt;/div&gt;&lt;div&gt;If Winsock1.state = 1 Then&lt;/div&gt;&lt;div&gt;Winsock1.Listen&lt;/div&gt;&lt;div&gt;Label3.Caption = Winsock1.state&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command3_Click()&lt;/div&gt;&lt;div&gt;If Winsock1.state = 2 Then&lt;/div&gt;&lt;div&gt;check = 1&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command4_Click()&lt;/div&gt;&lt;div&gt;Winsock2.SendData Text2.Text&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Form_Load()&lt;/div&gt;&lt;div&gt;Label1.Caption = Winsock1.LocalIP&lt;/div&gt;&lt;div&gt;Winsock1.LocalPort = 7777&lt;/div&gt;&lt;div&gt;Label2.Caption = Winsock1.LocalPort&lt;/div&gt;&lt;div&gt;Label3.Caption = Winsock1.state&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)&lt;/div&gt;&lt;div&gt;MsgBox &quot;有人來找&quot;&lt;/div&gt;&lt;div&gt;check = 0&lt;/div&gt;&lt;div&gt;Wait 5&lt;/div&gt;&lt;div&gt;If check = 1 Then&lt;/div&gt;&lt;div&gt;Winsock2.Accept requestID&lt;/div&gt;&lt;div&gt;Label4.Caption = Winsock2.state&lt;/div&gt;&lt;div&gt;Winsock2.SendData (&quot;yes&quot;)&lt;/div&gt;&lt;div&gt;MsgBox &quot;我會連線&quot;&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;Private Sub Wait(iSec As Long)&lt;/div&gt;&lt;div&gt;Dim iTimer As Long&lt;/div&gt;&lt;div&gt;    iTimer = Timer&lt;/div&gt;&lt;div&gt;    Do Until Timer - iTimer &amp;gt;= iSec&lt;/div&gt;&lt;div&gt;    If check = 1 Then&lt;/div&gt;&lt;div&gt;    iSec = 0&lt;/div&gt;&lt;div&gt;    End If&lt;/div&gt;&lt;div&gt;     DoEvents&lt;/div&gt;&lt;div&gt;    Loop&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)&lt;/div&gt;&lt;div&gt;Dim getdata As String&lt;/div&gt;&lt;div&gt;Winsock2.getdata getdata&lt;/div&gt;&lt;div&gt;List1.AddItem getdata&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/2269700716006270552/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week6-winsock.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/2269700716006270552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/2269700716006270552'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week6-winsock.html' title='網路核心程式設計-Week6-雙winsock接收通訊'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTn8SwFFl-MJzY2Y7i1bLvbwcd352x0G4T0xx98eJtwsPtuDqKVgt2NV8BQ2v2jzNkBqOhyEdzE7uzb_ShnETezfnxR1UOlhOuMsEEwWEi6E9KbocjKZJa7S7lFElrsse9JuvViaagd-c/s72-c/QQ%25E6%2588%25AA%25E5%259C%2596%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-1151581321572002124</id><published>2011-03-16T02:54:00.000-07:00</published><updated>2011-03-16T02:56:47.060-07:00</updated><title type='text'>網路核心程式設計-Week4-Udp網路猜拳</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8ZnEv2jVylfRnr53AazKPKHyuqg14bfPkMm4anAWNzMJi7mtgrxiamHg5ba2FQWR5MAG7aYbSijQHGf3SCI5jWVY4LljPbXJUaMTBEqmV6vta2cnXzEdpkYGDfj-ZnlUFjScTwiXNsY/s1600/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.jpg&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 210px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8ZnEv2jVylfRnr53AazKPKHyuqg14bfPkMm4anAWNzMJi7mtgrxiamHg5ba2FQWR5MAG7aYbSijQHGf3SCI5jWVY4LljPbXJUaMTBEqmV6vta2cnXzEdpkYGDfj-ZnlUFjScTwiXNsY/s320/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5584614559658273810&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dim x As Integer&lt;/div&gt;&lt;div&gt;Option Explicit&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub cmdConnect_Click()&lt;/div&gt;&lt;div&gt;   With udpPeerA&lt;/div&gt;&lt;div&gt;    .RemoteHost = txtHostName.Text&lt;/div&gt;&lt;div&gt;    If chkMain.Value Then&lt;/div&gt;&lt;div&gt;      .RemotePort = 1001   &#39;連線的連接埠號。&lt;/div&gt;&lt;div&gt;      .Bind 1002        &#39;連結到本機的連接埠。&lt;/div&gt;&lt;div&gt;    Else&lt;/div&gt;&lt;div&gt;      .RemotePort = 1002&lt;/div&gt;&lt;div&gt;      .Bind 1001&lt;/div&gt;&lt;div&gt;    End If&lt;/div&gt;&lt;div&gt;  End With&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub cmdSend_Click()&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    txtSend.Text = x&lt;/div&gt;&lt;div&gt;    udpPeerA.SendData txtSend.Text&lt;/div&gt;&lt;div&gt;    Select Case x&lt;/div&gt;&lt;div&gt;    Case 1&lt;/div&gt;&lt;div&gt;        If txtOutput.Text = 1 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 2 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 3 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;        End If&lt;/div&gt;&lt;div&gt;    Case 2&lt;/div&gt;&lt;div&gt;        If txtOutput.Text = 2 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 3 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 1 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;        End If&lt;/div&gt;&lt;div&gt;    Case 3&lt;/div&gt;&lt;div&gt;        If txtOutput.Text = 3 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 1 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;        ElseIf txtOutput.Text = 2 Then&lt;/div&gt;&lt;div&gt;        Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;        End If&lt;/div&gt;&lt;div&gt;    End Select&lt;/div&gt;&lt;div&gt;    DoEvents&lt;/div&gt;&lt;div&gt;   &lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command1_Click()&lt;/div&gt;&lt;div&gt;    Randomize Timer&lt;/div&gt;&lt;div&gt;   &lt;/div&gt;&lt;div&gt;    x = Int(Rnd() * 3 + 1)&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub udpPeerA_DataArrival(ByVal bytesTotal As Long)&lt;/div&gt;&lt;div&gt;  Dim strData As String&lt;/div&gt;&lt;div&gt;  udpPeerA.GetData strData&lt;/div&gt;&lt;div&gt;  txtOutput.Text = strData&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/1151581321572002124/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week4-udp.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1151581321572002124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1151581321572002124'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week4-udp.html' title='網路核心程式設計-Week4-Udp網路猜拳'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik8ZnEv2jVylfRnr53AazKPKHyuqg14bfPkMm4anAWNzMJi7mtgrxiamHg5ba2FQWR5MAG7aYbSijQHGf3SCI5jWVY4LljPbXJUaMTBEqmV6vta2cnXzEdpkYGDfj-ZnlUFjScTwiXNsY/s72-c/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-6432783981689285745</id><published>2011-03-09T00:42:00.000-08:00</published><updated>2011-03-09T01:04:56.070-08:00</updated><title type='text'>轉-認識每股盈餘 EPS</title><content type='html'>&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(83, 83, 83); &quot;&gt;每股盈餘(EPS:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;Earnings Per Share&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(83, 83, 83); &quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;  &gt;名詞定義:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;一家公司某一段時間的獲利(可分為稅前、稅後及常續性)除以流通在外發行股數，通常以元顯示，一般常用的是每股稅後盈餘。&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;  &gt;計算公式:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;  &gt;(年度盈餘 - 特別股股利)  ÷ 流通在外發行股數&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;(通常用加權平均)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(83, 83, 83); &quot;  &gt;使用方式：&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(83, 83, 83); &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(83, 83, 83); &quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 25px; &quot;&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;通常每股盈餘愈高，代表相對於原始投入資本而言，公司的獲利性愈高，EPS通常用來比較公司本身的獲利變化趨勢，但由於會受到無償配股、現金增資及公司債轉換等造成股本變化的因素影響，每股盈餘很少單獨使用，大都是用來和股價相除，成為常用的評價指標－&lt;/span&gt;&lt;a href=&quot;http://www.ntd2u.net/viewthread.php?tid=9&amp;amp;extra=page%3D1&quot; style=&quot;word-wrap: break-word; color: rgb(83, 83, 83); text-decoration: none; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span href=&quot;tag.php?name=%E6%9C%AC%E7%9B%8A%E6%AF%94&quot; class=&quot;t_tag&quot; style=&quot;word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; &quot;&gt;本益比&lt;/span&gt;(PER)&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;而EPS又可分為過去的每股盈餘(Trailing EPS)及預估每股盈餘(Forecasting EPS)，各位以本益比或EPS來衡量股價是否值得買進時，需特別留意你所用的EPS究竟是過去的每股盈餘還是預估每股盈餘，因為股價永遠是反應未來，單純就過去的獲利來衡量未來股價的變化，這是很危險的&lt;/span&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;過去的每股盈餘(建議觀察8～10年的表現)並非全然無用，因為透過公司歷年來的EPS波動程度，可以瞭解該公司的獲利是否會受到景氣循環嚴重影響，若是EPS歷年來呈現高低起伏有正有負的狀態，極可能就是景氣循環股，這種公司最好是在景氣不佳一段時間後較適合買進，景氣大好一段時間後適合賣出，例如...水泥、塑化、鋼鐵、營建、航運、&lt;span href=&quot;tag.php?name=DRAM&quot; class=&quot;t_tag&quot; style=&quot;word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; &quot;&gt;DRAM&lt;/span&gt;、&lt;span href=&quot;tag.php?name=TFT&quot; class=&quot;t_tag&quot; style=&quot;word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; &quot;&gt;TFT&lt;/span&gt; LCD(面板股)等，都屬於標準的景氣循環股。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;過去的每股盈餘若是呈現穩定的狹幅波動，又或是穩定的上升趨勢，則該公司的獲利，受到景氣影響的情況較低，這種公司多數被價值投資者所喜愛，當大盤市況不佳，股價有被嚴重低估的情況時，就值得風險規避型投資人來留意！&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;透過EPS計算出來的&lt;a href=&quot;http://www.ntd2u.net/viewthread.php?tid=9&amp;amp;extra=page%3D1&quot; style=&quot;word-wrap: break-word; color: rgb(83, 83, 83); text-decoration: none; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;本益比(PER或P/E)&lt;/span&gt;&lt;/a&gt;通常會與&lt;a href=&quot;http://www.ntd2u.net//thread-10-1-1.html&quot; style=&quot;word-wrap: break-word; color: rgb(83, 83, 83); text-decoration: none; line-height: normal; &quot;&gt;&lt;span href=&quot;tag.php?name=%E8%82%A1%E5%83%B9%E6%B7%A8%E5%80%BC%E6%AF%94&quot; class=&quot;t_tag&quot; style=&quot;word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; &quot;&gt;股價淨值比&lt;/span&gt;(PBR或P/B)&lt;/a&gt;一起用來衡量股價是否值得買進，換句話說，這是目前市場最常用來衡量股票貴不貴、值不值的二個工具了。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;備　　註：&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 25px; &quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;美國著名反向投資專家&lt;/span&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;大衛‧卓曼(David Dreman)&lt;/span&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;曾在1993年10月11日的富比士雜誌(Forbes Magazine)中指出，以1973年至1990年，統計美國分析師對股票季盈餘的67,375次預估中，平均預估錯誤率達40%，而預估錯誤超過10%的比例達三分之二，這個訊息表達了單純利用預估資料作投資決策的風險性。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;在此建議同學們試圖衡量預估EPS未來可實現的機率時，必須同步觀察公司每月營收變化、產銷組合變化、業外損益變化、過去五年EPS變動狀況。舉例來說，A公司縱使去年EPS高達10元，但是前年EPS僅2元，這表示該公司獲利波動幅度很大，今年的EPS就不容易估計了，而且去年EPS雖然高達10元，其參考性也不高。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;上述為市場中最常用的簡單每股盈餘，由於目前企業籌資方式靈活，且籌資區域也從台灣擴大到海外，因此較為謹慎的投資人應該考量可轉換證券對於簡單每股盈餘的稀釋效應。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;充分稀釋每股盈餘 (Fully Diluted Earnings Per Share) 是指在複雜資本結構下，基於穩健原則，考量最大可能的稀釋結果，引以計算出來的普通股每股盈餘。它和基本每股盈餘最大的差異，是在它也納入具有稀釋作用的「非約當普通股」，只要是有稀釋作用的可轉換證券，像是國內可轉換公司債、海外可轉換公司債、員工股票選擇權等，都會包含於計算充分稀釋每股盈餘的分母項。因為可轉換證券持有人一旦要求公司履約，企業的流通在外普通股數會增加。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;每股盈餘屬於帳面上的獲利，實際上公司當年度所增加的現金流入不會等同於獲利金額，尤其是誠信度不佳的公司，經常透過帳面美化的方式欺瞞投資人，因此千萬不可因為每股盈餘的高低，就決定了買賣股票的行為！&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;word-wrap: break-word; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;&lt;span style=&quot;word-wrap: break-word; line-height: normal; &quot;&gt;建議觀察每股盈餘EPS的同時，也同時觀察該公司的&lt;span href=&quot;tag.php?name=%E7%8F%BE%E9%87%91%E6%B5%81%E9%87%8F&quot; class=&quot;t_tag&quot; style=&quot;word-wrap: break-word; line-height: normal; cursor: pointer; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 0, 0); white-space: nowrap; &quot;&gt;現金流量&lt;/span&gt;表，尤其是&lt;a href=&quot;http://www.ntd2u.net/thread-2109-1-1.html&quot; style=&quot;word-wrap: break-word; color: rgb(83, 83, 83); text-decoration: none; line-height: normal; &quot;&gt;自由現金流量(FCF)&lt;/a&gt;，很多帳面上獲利的公司，最後成為地雷的原因就在於帳面上有賺錢，但是....現金沒有流入公司！&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(83, 83, 83); &quot;  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: -webkit-auto;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse;&quot;&gt;轉載自:&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.ntd2u.net/thread-11-1-1.html&quot;&gt;http://www.ntd2u.net/thread-11-1-1.html&lt;/a&gt;&lt;/span&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/6432783981689285745/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/03/eps.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/6432783981689285745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/6432783981689285745'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/03/eps.html' title='轉-認識每股盈餘 EPS'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-1807766549063950192</id><published>2011-03-09T00:26:00.001-08:00</published><updated>2011-03-09T00:40:03.628-08:00</updated><title type='text'>網路核心程式設計-Week3-剪刀石頭布</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwXxSzc7RCugXe48TTMjZYx0FZXNPwwOdixHsnS6YyclA0cs9Jve4k4gI_0aKozP7CSPQ4L4WxXyIXd-P-5mZjVTcZg14fjT-lpTByV11A58b8zCFOlGYMknnr_aYeUCOdvoBTsC6w1Hg/s1600/even.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 259px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwXxSzc7RCugXe48TTMjZYx0FZXNPwwOdixHsnS6YyclA0cs9Jve4k4gI_0aKozP7CSPQ4L4WxXyIXd-P-5mZjVTcZg14fjT-lpTByV11A58b8zCFOlGYMknnr_aYeUCOdvoBTsC6w1Hg/s320/even.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5581996901949665762&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGdk3tu9H_sYs6JXiVLH9toAvjJU57-2KfTj5Pj6ItusZwrDmmXx-lOsscF9eTIpqbx5EMCS13ixsqlotsZk5_iz9pyTt8R_WnR7ZjOp29FoBgCPJA2R1I1LgIHDFGccjw9wJIVcGo5T8/s1600/lose.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 259px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGdk3tu9H_sYs6JXiVLH9toAvjJU57-2KfTj5Pj6ItusZwrDmmXx-lOsscF9eTIpqbx5EMCS13ixsqlotsZk5_iz9pyTt8R_WnR7ZjOp29FoBgCPJA2R1I1LgIHDFGccjw9wJIVcGo5T8/s320/lose.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5581996902006552386&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikiwWhp38DuyrQb-L6iSt0OzkRDijGLjcGpJ-Ik6rGs9Ao7gPQLMUoyyXwucBNNoTo8Oeqkez919DaEPsl7QiVKEOD9v4psGvCnWW5-OjxB0MpONAG6EyxQNWo589cnwPrATfPhrMq_-s/s1600/win.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 259px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikiwWhp38DuyrQb-L6iSt0OzkRDijGLjcGpJ-Ik6rGs9Ao7gPQLMUoyyXwucBNNoTo8Oeqkez919DaEPsl7QiVKEOD9v4psGvCnWW5-OjxB0MpONAG6EyxQNWo589cnwPrATfPhrMq_-s/s320/win.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5581996898984957586&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;程式碼:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Dim x, y, z, p As Integer&lt;/div&gt;&lt;div&gt;Private Sub Command1_Click()&lt;/div&gt;&lt;div&gt;Randomize Timer&lt;/div&gt;&lt;div&gt;x = Int(Rnd * 3) + 1&lt;/div&gt;&lt;div&gt;Picture1.Visible = True&lt;/div&gt;&lt;div&gt;Picture2.Visible = False&lt;/div&gt;&lt;div&gt;Picture3.Visible = False&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If (x = 1) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;Picture4.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;p = p + 1&lt;/div&gt;&lt;div&gt;Text4.Text = p&lt;/div&gt;&lt;div&gt;ElseIf (x = 2) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;Picture5.Visible = True&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;y = y + 1&lt;/div&gt;&lt;div&gt;Text3.Text = y&lt;/div&gt;&lt;div&gt;ElseIf (x = 3) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;Picture6.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;z = z + 1&lt;/div&gt;&lt;div&gt;Text2.Text = z&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command2_Click()&lt;/div&gt;&lt;div&gt;Randomize Timer&lt;/div&gt;&lt;div&gt;x = Int(Rnd * 3) + 1&lt;/div&gt;&lt;div&gt;Picture2.Visible = True&lt;/div&gt;&lt;div&gt;Picture1.Visible = False&lt;/div&gt;&lt;div&gt;Picture3.Visible = False&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If (x = 1) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;Picture4.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;z = z + 1&lt;/div&gt;&lt;div&gt;Text2.Text = z&lt;/div&gt;&lt;div&gt;ElseIf (x = 2) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;Picture5.Visible = True&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;p = p + 1&lt;/div&gt;&lt;div&gt;Text4.Text = p&lt;/div&gt;&lt;div&gt;ElseIf (x = 3) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;Picture6.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;y = y + 1&lt;/div&gt;&lt;div&gt;Text3.Text = y&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command3_Click()&lt;/div&gt;&lt;div&gt;Randomize Timer&lt;/div&gt;&lt;div&gt;x = Int(Rnd * 3) + 1&lt;/div&gt;&lt;div&gt;Picture3.Visible = True&lt;/div&gt;&lt;div&gt;Picture2.Visible = False&lt;/div&gt;&lt;div&gt;Picture1.Visible = False&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If (x = 1) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你輸了&quot;&lt;/div&gt;&lt;div&gt;Picture4.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;y = y + 1&lt;/div&gt;&lt;div&gt;Text3.Text = y&lt;/div&gt;&lt;div&gt;ElseIf (x = 2) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;你贏了&quot;&lt;/div&gt;&lt;div&gt;Picture5.Visible = True&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;z = z + 1&lt;/div&gt;&lt;div&gt;Text2.Text = z&lt;/div&gt;&lt;div&gt;ElseIf (x = 3) Then&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;平手&quot;&lt;/div&gt;&lt;div&gt;Picture6.Visible = True&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;p = p + 1&lt;/div&gt;&lt;div&gt;Text4.Text = p&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Form_Load()&lt;/div&gt;&lt;div&gt;Picture1.Visible = False&lt;/div&gt;&lt;div&gt;Picture2.Visible = False&lt;/div&gt;&lt;div&gt;Picture3.Visible = False&lt;/div&gt;&lt;div&gt;Picture4.Visible = False&lt;/div&gt;&lt;div&gt;Picture5.Visible = False&lt;/div&gt;&lt;div&gt;Picture6.Visible = False&lt;/div&gt;&lt;div&gt;Text1.Text = 0&lt;/div&gt;&lt;div&gt;Text2.Text = 0&lt;/div&gt;&lt;div&gt;Text3.Text = 0&lt;/div&gt;&lt;div&gt;Text4.Text = 0&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/1807766549063950192/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week3.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1807766549063950192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1807766549063950192'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/03/week3.html' title='網路核心程式設計-Week3-剪刀石頭布'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwXxSzc7RCugXe48TTMjZYx0FZXNPwwOdixHsnS6YyclA0cs9Jve4k4gI_0aKozP7CSPQ4L4WxXyIXd-P-5mZjVTcZg14fjT-lpTByV11A58b8zCFOlGYMknnr_aYeUCOdvoBTsC6w1Hg/s72-c/even.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-1961509847441411981</id><published>2011-03-01T22:33:00.000-08:00</published><updated>2011-03-01T23:08:48.686-08:00</updated><title type='text'>網路核心程式設計-Week2-樂透擲杯</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aCiBf7JKBR1y0B-sFpMAmY-p92WXeSpVlOlg7dLUi38pUUErpH0hfJyzLYSSkpiNQbOccPbgHHPJAw4CvvHplaqSSrZogbtob0siOIF1tZFVrGFNmRXkK7ctZzBAzQBnDxqnaVTYbko/s1600/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 245px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aCiBf7JKBR1y0B-sFpMAmY-p92WXeSpVlOlg7dLUi38pUUErpH0hfJyzLYSSkpiNQbOccPbgHHPJAw4CvvHplaqSSrZogbtob0siOIF1tZFVrGFNmRXkK7ctZzBAzQBnDxqnaVTYbko/s320/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png&quot; border=&quot;0&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5579371195931024434&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;Dim count1 As Integer&lt;/div&gt;&lt;div&gt;Private Sub Command1_Click()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Dim num, i, j, certain(5) As Integer&lt;/div&gt;&lt;div&gt;Command2.Enabled = True&lt;/div&gt;&lt;div&gt;count1 = 0&lt;/div&gt;&lt;div&gt;Text1.Text = &quot;&quot;&lt;/div&gt;&lt;div&gt;Text2.Text = &quot;&quot;&lt;/div&gt;&lt;div&gt;Label1 = &quot;&quot;&lt;/div&gt;&lt;div&gt;Randomize Timer&lt;/div&gt;&lt;div&gt;For i = 0 To 5&lt;/div&gt;&lt;div&gt;rechoose:&lt;/div&gt;&lt;div&gt;certain(i) = Int(Rnd * 49) + 1&lt;/div&gt;&lt;div&gt;For j = 0 To i - 1&lt;/div&gt;&lt;div&gt;If certain(i) = certain(j) Then&lt;/div&gt;&lt;div&gt;GoTo rechoose&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;Next j&lt;/div&gt;&lt;div&gt;Text1 = Text1 &amp;amp; &quot; &quot; &amp;amp; certain(i)&lt;/div&gt;&lt;div&gt;Next i&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Command2_Click()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;x = Int(Rnd() * 4 + 1)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If x = 1 Then&lt;/div&gt;&lt;div&gt;    Picture1(0).Visible = True&lt;/div&gt;&lt;div&gt;    Picture2.Visible = False&lt;/div&gt;&lt;div&gt;    Picture3.Visible = False&lt;/div&gt;&lt;div&gt;    count1 = count1 + 1&lt;/div&gt;&lt;div&gt;ElseIf x = 2 Then&lt;/div&gt;&lt;div&gt;    Picture1(0).Visible = False&lt;/div&gt;&lt;div&gt;    Picture2.Visible = True&lt;/div&gt;&lt;div&gt;    Picture3.Visible = False&lt;/div&gt;&lt;div&gt;    Command2.Enabled = False&lt;/div&gt;&lt;div&gt;ElseIf x = 3 Then&lt;/div&gt;&lt;div&gt;    Picture1(0).Visible = True&lt;/div&gt;&lt;div&gt;    Picture2.Visible = False&lt;/div&gt;&lt;div&gt;    Picture3.Visible = False&lt;/div&gt;&lt;div&gt;    count1 = count1 + 1&lt;/div&gt;&lt;div&gt;Else&lt;/div&gt;&lt;div&gt;    Picture1(0).Visible = False&lt;/div&gt;&lt;div&gt;    Picture2.Visible = False&lt;/div&gt;&lt;div&gt;    Picture3.Visible = True&lt;/div&gt;&lt;div&gt;    Command2.Enabled = False&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Text2.Text = count1&lt;/div&gt;&lt;div&gt;If count1 = 3 Then&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Text1.ForeColor = &amp;amp;HFF&amp;amp;&lt;/div&gt;&lt;div&gt;End If&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Form_Load()&lt;/div&gt;&lt;div&gt;Picture1(0).Visible = False&lt;/div&gt;&lt;div&gt;Picture2.Visible = False&lt;/div&gt;&lt;div&gt;Picture3.Visible = False&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Private Sub Label1_Click()&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/1961509847441411981/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/03/000.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1961509847441411981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/1961509847441411981'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/03/000.html' title='網路核心程式設計-Week2-樂透擲杯'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aCiBf7JKBR1y0B-sFpMAmY-p92WXeSpVlOlg7dLUi38pUUErpH0hfJyzLYSSkpiNQbOccPbgHHPJAw4CvvHplaqSSrZogbtob0siOIF1tZFVrGFNmRXkK7ctZzBAzQBnDxqnaVTYbko/s72-c/%25E6%259C%25AA%25E5%2591%25BD%25E5%2590%258D.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6196253701031212921.post-3413764235386295718</id><published>2011-02-23T07:23:00.000-08:00</published><updated>2011-02-23T07:29:29.528-08:00</updated><title type='text'>網路核心程式設計-Week1</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(96, 96, 96); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; &quot;&gt;&lt;p style=&quot;line-height: 15px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; &quot;&gt;1.為何why要選修這門課?(動機)&lt;/p&gt;希望能夠在這門課程裡面增進自己的程式語言能力&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: collapse; color: rgb(96, 96, 96); font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 15px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; &quot;&gt;&lt;br /&gt;&lt;p style=&quot;line-height: 15px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; &quot;&gt;2.希望從這門課獲得那些知識?(目標)&lt;/p&gt;&lt;div&gt;網路核心所以希望能夠學到網路協定之間的互相溝通方法的實作&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;line-height: 15px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; &quot;&gt;3.我要如何修習這一門課?(態度與方法)&lt;/p&gt;&lt;div&gt;上課的時候認真聽課練習並記錄下來 回去的時候照著自己的部落格在練習一次&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;line-height: 15px; margin-top: 0px; margin-right: 0px; margin-bottom: 1.35em; margin-left: 0px; &quot;&gt;who, when, where M410&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://waltcheung.blogspot.com/feeds/3413764235386295718/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://waltcheung.blogspot.com/2011/02/week1.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/3413764235386295718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6196253701031212921/posts/default/3413764235386295718'/><link rel='alternate' type='text/html' href='http://waltcheung.blogspot.com/2011/02/week1.html' title='網路核心程式設計-Week1'/><author><name>WaltCheung</name><uri>http://www.blogger.com/profile/10793440369163931006</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>