<?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-3668391560306792513</id><updated>2025-07-14T10:05:53.604+08:00</updated><category term="VB.NET"/><category term="ASP.NET"/><category term="Office"/><category term="VB6"/><category term="JavaScript"/><category term="隨手文章"/><category term="HTML"/><category term="NPOI 1.2.5"/><category term="SQL"/><category term="Tools"/><category term="CSS"/><category term="Demo"/><category term="Windows Firewall"/><category term="Windows"/><title type='text'>Just a note</title><subtitle type='html'>生活中的點滴，其實都是一種感動；祇是很少有人，會去欣賞 0 與 1 的字裡行間！</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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>139</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-6423235721761320321</id><published>2024-10-08T22:57:00.001+08:00</published><updated>2024-10-08T23:00:43.381+08:00</updated><title type='text'>ASP.NET 使用meta content= text/html 方式，將  Gridview export to Excel </title><content type='html'>
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhau3AAbf515BlylomGnr1SvvS2uBGG68COJPf8eQq09b97zUbd31kblNzT6zHvEnSGN50_HTIAU2hkvTevRtNBx0yhhaIo-eXiAC7WMZM2gw8Bj6_TkUrRadv14n0sO2XhIMr6s-mS79y1/s1600/3333.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhau3AAbf515BlylomGnr1SvvS2uBGG68COJPf8eQq09b97zUbd31kblNzT6zHvEnSGN50_HTIAU2hkvTevRtNBx0yhhaIo-eXiAC7WMZM2gw8Bj6_TkUrRadv14n0sO2XhIMr6s-mS79y1/s640/3333.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;meta content= text/html and &amp;nbsp;gridview export to excel&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLyylPmshXFRj_q9KLgQQfBJo1AyZW8ZLqVJOKO_wgv5nVSbcy7XatHcYW2Sn4C43RtqUFvjOs8m3oC-NZplm-ckMqgkuXg_kZLzQsuPJFudt-PnNp_aFa4FkhCtVwbVlZXYx710SuABsr/s1600/0000.PNG&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLyylPmshXFRj_q9KLgQQfBJo1AyZW8ZLqVJOKO_wgv5nVSbcy7XatHcYW2Sn4C43RtqUFvjOs8m3oC-NZplm-ckMqgkuXg_kZLzQsuPJFudt-PnNp_aFa4FkhCtVwbVlZXYx710SuABsr/s320/0000.PNG&quot; width=&quot;265&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;資料匯出&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXW6bsJGtApozgTtGPyJbqSqOgl2gjhSz-pO4nrOblAgLn1tSjjdZZMCRgHq2avT1ZAWbqxZH7yFT_beaF8dQC_Cqg2dqtWfwAmqXNpHjlHEWfn9Id_5zO-3jdUBA9NPwUWjcmJZD7hO4/s1600/1111.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;73&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIXW6bsJGtApozgTtGPyJbqSqOgl2gjhSz-pO4nrOblAgLn1tSjjdZZMCRgHq2avT1ZAWbqxZH7yFT_beaF8dQC_Cqg2dqtWfwAmqXNpHjlHEWfn9Id_5zO-3jdUBA9NPwUWjcmJZD7hO4/s640/1111.PNG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;由於是meta content= text/html&amp;nbsp;格式，所以報錯&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO1gTq9zq0mbQlbLWUPSmmQ28d4z_KiGlZ3X0orgkXll0_MCh8NJKVnHBZP9key48BfT_MvLWDTmUuIxWCQNBJ59KG0S-8qreHOgwGPswsttZ9OcoalRWUEzsb7_3mfIkASOiwSfXycSBg/s1600/2222.PNG&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO1gTq9zq0mbQlbLWUPSmmQ28d4z_KiGlZ3X0orgkXll0_MCh8NJKVnHBZP9key48BfT_MvLWDTmUuIxWCQNBJ59KG0S-8qreHOgwGPswsttZ9OcoalRWUEzsb7_3mfIkASOiwSfXycSBg/s320/2222.PNG&quot; width=&quot;168&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;格式與網頁一樣&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&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;
.ASP&lt;/div&gt;
&lt;div&gt;
......................&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;lt;head runat=&quot;server&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/head&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;body&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;form id=&quot;form1&quot; runat=&quot;server&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;div&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; /&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:UpdatePanel ID=&quot;UpdatePanel1&quot; runat=&quot;server&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;ContentTemplate&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:Button ID=&quot;btnExport&quot; runat=&quot;server&quot; Text=&quot;匯出&quot; Font-Size=&quot;X-Large&quot; Width=&quot;100px&quot; /&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:GridView ID=&quot;GridView1&quot; runat=&quot;server&quot; /&amp;gt; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/ContentTemplate&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;triggers&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;asp:postbacktrigger controlid=&quot;btnExport&quot; /&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/triggers&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/asp:UpdatePanel&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/form&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;lt;/body&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
.ASP.VB&lt;/div&gt;
&lt;div&gt;
......................&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not IsPostBack Then&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DatatableBindToGridview()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Private Sub DatatableBindToGridview()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim dt As New DataTable&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With dt&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Columns.Add(&quot;格式1&quot;, GetType(String))&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Columns.Add(&quot;格式2&quot;, GetType(String))&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To 10&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Rows.Add()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Rows(i).Item(0) = Format(i, &quot;00&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Rows(i).Item(1) = Format(i, &quot;00&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With GridView1&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .DataSource = dt&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .DataBind()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .HorizontalAlign = HorizontalAlign.Center&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .GridLines = GridLines.Both&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .HeaderStyle.BorderColor = Drawing.Color.Black&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .HeaderStyle.BackColor = Drawing.Color.Gray&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .HeaderStyle.ForeColor = Drawing.Color.White&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Font.Size = 14&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Private Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If GridView1.Rows.Count &amp;lt; 0 Then Exit Sub&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If e.Row.RowType = DataControlRowType.DataRow Then&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If e.Row.RowIndex Mod 2 = 0 Then&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Row.BackColor = Drawing.Color.LemonChiffon&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.Row.BackColor = Drawing.Color.AliceBlue&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;少了這個Sub&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;GridView1.RenderControl 時會產生&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;型別 &#39;GridView&#39; 的控制項&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;GridView1 必須置於有 runat=server 的表單標記之中。&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnExport.Click&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim sw As New System.IO.StringWriter&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim hw As New System.Web.UI.HtmlTextWriter(sw)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; GridView1.RenderControl(hw)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With Response&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ClearContent()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AppendHeader(&quot;Content-Disposition&quot;, &quot;attachment; filename=&quot; &amp;amp; Format(Now, &quot;yyyyMMdd HHmmss&quot;) &amp;amp; &quot;.xls&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .ContentType = &quot;application/vnd.ms-excel&quot;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Write(&quot;&amp;lt;meta http-equiv=&#39;Content-Type&#39; content=&#39;text/html; charset=utf-8&#39;&amp;gt;&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Write(&quot;&amp;lt;style type=text/css&amp;gt;&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Write(&quot;td{mso-number-format:\@;}&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Write(&quot;&amp;lt;/style&amp;gt;&quot;)&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Write(sw.ToString())&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .End()&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/6423235721761320321/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2016/12/aspnet-meta-content-texthtml-gridview.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/6423235721761320321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/6423235721761320321'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2016/12/aspnet-meta-content-texthtml-gridview.html' title='ASP.NET 使用meta content= text/html 方式，將  Gridview export to Excel '/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEhau3AAbf515BlylomGnr1SvvS2uBGG68COJPf8eQq09b97zUbd31kblNzT6zHvEnSGN50_HTIAU2hkvTevRtNBx0yhhaIo-eXiAC7WMZM2gw8Bj6_TkUrRadv14n0sO2XhIMr6s-mS79y1/s72-c/3333.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-7772212598549379111</id><published>2024-10-08T22:56:00.003+08:00</published><updated>2024-10-08T23:02:23.947+08:00</updated><title type='text'>gridview 分頁 mssql 語法</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKgVcZRpBogyrNOdKuC2_qrpwDIguhJNqbvbvl2iBXHQrPHGhfIsOomn8FFzOY6mcK4MKuQMqtg0nh4ytlSqD_zAQBlqa9FSOzByWkGX1Pt4eCS6hl3D4trm6FfAw5XFYsGFw2GmFjihzk/s1600/pages.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKgVcZRpBogyrNOdKuC2_qrpwDIguhJNqbvbvl2iBXHQrPHGhfIsOomn8FFzOY6mcK4MKuQMqtg0nh4ytlSqD_zAQBlqa9FSOzByWkGX1Pt4eCS6hl3D4trm6FfAw5XFYsGFw2GmFjihzk/s1600/pages.PNG&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
先使用 select count 做總筆數與每頁幾筆與分頁的安排&lt;br /&gt;
&lt;br /&gt;
layout 如右《 1 2 3 4 5 6 7 8 9 10 》&lt;br /&gt;
一次秀十頁與超過十頁後下拉選項的頁數&lt;br /&gt;
&lt;br /&gt;
如程式點 8 且每頁10筆&lt;br /&gt;
則 Row BETWEEN (8 - 1)&amp;nbsp;* 10&amp;nbsp;+ 1&amp;nbsp;AND 8 * 10&lt;br /&gt;
&lt;br /&gt;
如程式點 2 且每頁20筆&lt;br /&gt;
則 Row BETWEEN (2 - 1) * 20 + 1&amp;nbsp;AND 2 * 20&lt;br /&gt;
&lt;br /&gt;
WITH tmpTable AS &lt;br /&gt;
( &lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;SELECT&lt;/span&gt; ROW_NUMBER() OVER (&lt;span style=&quot;color: red;&quot;&gt;ORDER BY A001 DESC&lt;/span&gt;) AS Row , &lt;span style=&quot;color: red;&quot;&gt;A001, A002, A003, A004,&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;A005, Pass&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;FROM &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DSN001&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;WHERE A004 like &#39;%2%&#39; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
)&lt;br /&gt;
select * from tmpTable WHERE Row BETWEEN 2 AND 5&lt;br /&gt;
&lt;br /&gt;
紅字為原本 sql 語法&lt;br /&gt;
除了排序的部份&lt;br /&gt;
要拆放在 row number&lt;br /&gt;
其他直接套用&lt;br /&gt;
&lt;br /&gt;
這會有效減少頻寬的浪費&lt;br /&gt;

&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/7772212598549379111/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2017/03/gridview-mssql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/7772212598549379111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/7772212598549379111'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2017/03/gridview-mssql.html' title='gridview 分頁 mssql 語法'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiKgVcZRpBogyrNOdKuC2_qrpwDIguhJNqbvbvl2iBXHQrPHGhfIsOomn8FFzOY6mcK4MKuQMqtg0nh4ytlSqD_zAQBlqa9FSOzByWkGX1Pt4eCS6hl3D4trm6FfAw5XFYsGFw2GmFjihzk/s72-c/pages.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-8699279343216428340</id><published>2024-10-08T22:56:00.002+08:00</published><updated>2024-10-08T23:01:33.123+08:00</updated><title type='text'>jquery ajax ashx</title><content type='html'>&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function DivRemove(obj, str) { &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var text = obj.name;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var formdata = new FormData();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; formdata.append(&quot;myText&quot;, text);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var ajax = new XMLHttpRequest();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.open(&quot;POST&quot;, &quot;Dol.ashx&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.send(formdata);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var newobj = &#39;#&#39; + str&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $(str).remove();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ WebHandler Language=&quot;VB&quot; Class=&quot;Dol&quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Imports System&lt;br /&gt;
Imports System.Web&lt;br /&gt;
Imports System.IO&lt;br /&gt;
Imports System.Web.SessionState&lt;br /&gt;
&lt;br /&gt;
Public Class Dol: Implements IHttpHandler, IRequiresSessionState&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;br /&gt;
&amp;nbsp; Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim savepath As String = &quot;&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim tempPath As String = &quot;&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tempPath = System.Configuration.ConfigurationManager.AppSettings(&quot;FolderPath&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; savepath = context.Server.MapPath(tempPath)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim FileName As String = context.Request(&quot;myText&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Dim FileNameArr As String() = Split(FileName, &quot;\&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;FileName = Format(Now, &quot;yyyyMMdd HHmmss&quot;) &amp;amp; &quot;.&quot; &amp;amp; FileNameArr(FileNameArr.Length - 1)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If File.Exists(savepath &amp;amp; &quot;\&quot; &amp;amp; FileName) = True Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; File.Delete(savepath &amp;amp; &quot;\&quot; &amp;amp; FileName)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Get&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return False&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Get&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Property&lt;br /&gt;
&lt;br /&gt;
End Class&lt;br /&gt;

&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/8699279343216428340/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2017/02/jquery-ajax-ashx.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8699279343216428340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8699279343216428340'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2017/02/jquery-ajax-ashx.html' title='jquery ajax ashx'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-3402097401620662191</id><published>2024-10-08T22:54:00.000+08:00</published><updated>2024-10-08T22:54:53.819+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>文字長度測試</title><content type='html'>&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; function CountStrLen(obj1, obj2) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var str = obj1.value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj2.value = str.length;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;input id=&quot;txt1&quot; onkeyup=&quot;CountStrLen(this,txt2)&quot; type=&quot;text&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;input id=&quot;txt2&quot; type=&quot;text&quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:textbox id=&quot;TextBox1&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:textbox id=&quot;TextBox2&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox1.Attributes.Add(&quot;onkeyup&quot;, &quot;CountStrLen(&quot; &amp;amp;amp; TextBox1.ClientID &amp;amp;amp; &quot;,&quot; &amp;amp;amp; TextBox2.ClientID &amp;amp;amp; &quot;)&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TextBox2.ReadOnly = True&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
如果要接收長度不是 textbox 而是 label 或 span 等等有 ID 的 html tag&lt;br /&gt;
要用 innerHTML&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;txtState.Attributes.Add(&quot;onkeyup&quot;, &quot;CountStrLen1(&quot; &amp;amp; txtState.ClientID &amp;amp; &quot;,&quot; &amp;amp; Label1.ClientID &amp;amp; &quot;)&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; function CountStrLen1(obj1, obj2) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var str = obj1.value;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; obj2.innerHTML = str.length;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/3402097401620662191/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2017/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3402097401620662191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3402097401620662191'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2017/05/blog-post.html' title='文字長度測試'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-4432340703298382009</id><published>2024-08-04T15:17:00.003+08:00</published><updated>2024-08-04T15:17:55.090+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><title type='text'>用二個DIV做出立體按鈕</title><content type='html'>&lt;p&gt;&amp;nbsp;&amp;lt;div class=&quot;gradO parent&quot; onclick=&quot;myFunction()&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&quot;gradI parent&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;div id=&quot;demo&quot; style=&quot;width:100%;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*border:1px solid gray;*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; word-break: break-all;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text-align:center;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; padding:4px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; color:white;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; font:20px arial;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; text-shadow: 2px 2px 4px #000000;&quot;&amp;gt;查詢&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;style&amp;gt;&lt;/p&gt;&lt;p&gt;.gradO {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; /* border:1px solid gray;*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; width:72px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; height:72px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; padding: 8px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; border-radius:50%;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; background-image: linear-gradient(45deg, rgb(255,0,0), rgb(255,182,193));&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;.gradO:hover {&lt;/p&gt;&lt;p&gt;&amp;nbsp; box-shadow: 5px 10px 18px #d5d5d5;&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;.parent {&lt;/p&gt;&lt;p&gt;&amp;nbsp; display: flex;&lt;/p&gt;&lt;p&gt;&amp;nbsp; justify-content: center;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; align-content: center;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; flex-wrap: wrap;&lt;/p&gt;&lt;p&gt;&amp;nbsp; cursor:default;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;.parent:hover {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; cursor:pointer;&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;.gradI {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; padding: 6px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; width:56px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; height:56px;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; border-radius:50%;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; background-image: linear-gradient(45deg, rgb(255,182,193), rgb(255,0,0));&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;&amp;lt;/style&amp;gt;&lt;/p&gt;&lt;p&gt;省略 myFunction&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/4432340703298382009/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2024/08/div.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4432340703298382009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4432340703298382009'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2024/08/div.html' title='用二個DIV做出立體按鈕'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-3742444182487794814</id><published>2024-08-04T15:08:00.002+08:00</published><updated>2024-08-04T15:08:40.488+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>html table 常用設定</title><content type='html'>&lt;p&gt;&amp;nbsp;&amp;lt;style&amp;gt;&lt;/p&gt;&lt;p&gt;.tableFixHead { overflow: auto; height: 300px; width: fit-content;}&lt;/p&gt;&lt;p&gt;.tableFixHead table { border-collapse: collapse; font:20px arial;}&lt;/p&gt;&lt;p&gt;.tableFixHead th, td { padding: 5px; border-radius: 1px; border: 1px solid lightgray;}&lt;/p&gt;&lt;p&gt;.tableFixHead thead { position: sticky; top: -1px; z-index: 1; background-color: gray; color: #fff; text-shadow: 1px 1px 2px #000; text-align:center;}&lt;/p&gt;&lt;p&gt;.tableFixHead tbody tr:nth-child(odd) { background-color: LemonChiffon;}&lt;/p&gt;&lt;p&gt;.tableFixHead tbody tr:nth-child(even) { background-color: AliceBlue;}&lt;/p&gt;&lt;p&gt;.tableFixHead tbody tr:hover { background-color: lightskyblue;}&lt;/p&gt;&lt;p&gt;.tableFixHead tbody tr.selected { border: 2px solid red; background-color: darkgray; color: #fff; text-shadow: 1px 1px 2px #000;}&lt;/p&gt;&lt;p&gt;&amp;lt;/style&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;script&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; const rows = document.querySelectorAll(&#39;tbody tr&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; for (let i = 0; i &amp;lt; rows.length; i++) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rows[i].onclick = function () {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; highlightTableRow(this);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; function highlightTableRow(row) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; const previouslySelectedRow = document.querySelector(&#39;tr.selected&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (previouslySelectedRow) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; previouslySelectedRow.classList.remove(&#39;selected&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; row.classList.add(&#39;selected&#39;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/3742444182487794814/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2024/08/html-table.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3742444182487794814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3742444182487794814'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2024/08/html-table.html' title='html table 常用設定'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-4836396770350985393</id><published>2023-02-22T20:50:00.001+08:00</published><updated>2023-02-22T20:51:35.207+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>民國年月日</title><content type='html'>&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;function&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;Year1911() {&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;d =&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;new&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;Date();&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;yyy = d.getFullYear() - 1911;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;MM = d.getMonth() + 1;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MM = MM &amp;gt; 10 ? MM :&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&#39;0&#39;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;+ MM;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;var&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;dd = d.getDate();&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dd = dd &amp;gt; 10 ? dd :&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&#39;0&#39;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;+ dd;&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: 細明體; font-size: 9.5pt;&quot;&gt;return&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;(yyy +&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;+ MM +&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #a31515; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;+ dd);&lt;u&gt;&lt;/u&gt;&lt;u&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: small; margin: 0px;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: 細明體; font-size: 9.5pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/4836396770350985393/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2023/02/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4836396770350985393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4836396770350985393'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2023/02/blog-post.html' title='民國年月日'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-191738727233584123</id><published>2020-05-13T07:27:00.000+08:00</published><updated>2020-05-13T07:27:25.897+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>ASP.NET AutoCompleteExtender 模糊查詢下拉式選單</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVQqyo4npj-e62Z0Ab8-5Db3WP_ONyFAJDLIDQNGfWYhmxobYRN-q3PotiNm0cajj0jw0JvFLOd1BQI_cz3vHphajAJQBwHZEIAykN08m4NE2cMq-rieUFxhd3Ta9wf_0zAxo7hBDLxS0F/s1600/ggg.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVQqyo4npj-e62Z0Ab8-5Db3WP_ONyFAJDLIDQNGfWYhmxobYRN-q3PotiNm0cajj0jw0JvFLOd1BQI_cz3vHphajAJQBwHZEIAykN08m4NE2cMq-rieUFxhd3Ta9wf_0zAxo7hBDLxS0F/s400/ggg.PNG&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;查詢鼎新會計科目為例&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
.ASPX&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:ScriptManager ID=&quot;ScriptManager1&quot; runat=&quot;server&quot; EnablePageMethods = &quot;true&quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:TextBox ID=&quot;txtItem&quot; runat=&quot;server&quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;asp:AutoCompleteExtender&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;runat=&quot;server&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ID=&quot;AutoCompleteExtender1&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TargetControlID=&quot;txtItem&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServiceMethod=&quot;SearchItem&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MinimumPrefixLength=&quot;1&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CompletionInterval=&quot;100&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EnableCaching=&quot;false&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CompletionSetCount=&quot;10&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FirstRowSelected = &quot;false&quot; &amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/asp:AutoCompleteExtender&amp;gt;&lt;br /&gt;
&lt;br /&gt;
.ASPX.VB&lt;br /&gt;
&lt;br /&gt;
Imports System.Data.SqlClient&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;System.Web.Script.Services.ScriptMethod(), System.Web.Services.WebMethod()&amp;gt; _&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Public Shared Function SearchItem(ByVal prefixText As String, ByVal count As Integer) As List(Of String)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim cn As New SqlConnection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.ConnectionString = ConfigurationManager.ConnectionStrings(&quot;myConn&quot;).ConnectionString&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Open()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim cmd As New SqlCommand&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Connection = cn&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.CommandText = &quot;select distinct top (@MyCount) TH004, TH008 from COPTH where TH004 LIKE @SearchText + &#39;%&#39;&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.AddWithValue(&quot;@MyCount&quot;, count)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmd.Parameters.AddWithValue(&quot;@SearchText&quot;, prefixText)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim customers As List(Of String) = New List(Of String)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim sdr As SqlDataReader&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sdr = cmd.ExecuteReader()&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; While sdr.Read&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; customers.Add(sdr(&quot;TH004&quot;).ToString &amp;amp; vbNewLine &amp;amp; &quot; &quot; &amp;amp; sdr(&quot;TH008&quot;).ToString)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End While&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cn.Close()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return customers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Function&lt;br /&gt;
&lt;br /&gt;
web.config&lt;br /&gt;
&amp;nbsp; &amp;lt;connectionStrings&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;myConn&quot; connectionString=&quot;Data Source=.\SQLExpress;Initial Catalog=myDB;Persist Security Info=True;User ID=myID;Password=myPWD&quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/191738727233584123/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2020/05/aspnet-autocompleteextender.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/191738727233584123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/191738727233584123'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2020/05/aspnet-autocompleteextender.html' title='ASP.NET AutoCompleteExtender 模糊查詢下拉式選單'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiVQqyo4npj-e62Z0Ab8-5Db3WP_ONyFAJDLIDQNGfWYhmxobYRN-q3PotiNm0cajj0jw0JvFLOd1BQI_cz3vHphajAJQBwHZEIAykN08m4NE2cMq-rieUFxhd3Ta9wf_0zAxo7hBDLxS0F/s72-c/ggg.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-8408699838778445745</id><published>2019-01-15T12:30:00.000+08:00</published><updated>2019-01-15T12:31:11.492+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>api-ms-win-crt-runtime-l1-1-0.dll</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6x1zEk6rTK2r2kQCSKAmL-hS3hyn8RdH-PZVwBxwNxq3wFInOOkKNzFxpDHhtcdQilypTpgocWXtv7XYeBXMwMGBvOUY2jYxNJ_l6bNKFoGJTAiSzfYE52Gj1BP7i_KlwJySNWMUYFs3Y/s1600/123.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;255&quot; data-original-width=&quot;728&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6x1zEk6rTK2r2kQCSKAmL-hS3hyn8RdH-PZVwBxwNxq3wFInOOkKNzFxpDHhtcdQilypTpgocWXtv7XYeBXMwMGBvOUY2jYxNJ_l6bNKFoGJTAiSzfYE52Gj1BP7i_KlwJySNWMUYFs3Y/s400/123.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;    
.divScrollAuto {    
                height:500px;
                width:680px;
                overflow:auto;
                white-space:wrap;
               }
&lt;/style&gt;

&lt;br /&gt;
&lt;div class=&quot;divScrollAuto&quot;&gt;
&lt;br /&gt;
今天使用者問了一個問題，上網查了一下資料 ；不少應用軟體都會出現這個問題。&lt;br /&gt;
&lt;br /&gt;
解決方法如下：&lt;br /&gt;
Windows 中通用 C 執行階段的更新 KB2999226&lt;br /&gt;
&lt;a href=&quot;https://support.microsoft.com/zh-tw/help/2999226/update-for-universal-c-runtime-in-windows&quot; target=&quot;_blank&quot;&gt;請在微軟提供的資料中，尋找對應版本下載&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
如果你的電腦沒有升級 SP，請先到這裡下載對應版本&lt;br /&gt;
&lt;a href=&quot;https://support.microsoft.com/zh-tw/help/2533552/an-update-that-prevents-a-0xc0000034-error-message-when-you-try-to-ins&quot; target=&quot;_blank&quot;&gt;當您嘗試安裝 Windows 7 SP1、Windows Server 2008 R2 SP1 或 Windows Embedded Standard 7 SP1 時，可取得防止「0xC0000034」錯誤訊息出現的更新&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
如果你的電腦沒有安裝 Visual C++，也請到這裡下載對應版本&lt;br /&gt;
&lt;a href=&quot;https://www.microsoft.com/zh-TW/download/details.aspx?id=48145&quot; target=&quot;_blank&quot;&gt;下載Visual C++ 可轉散發套件會安裝執行階段元件，這些是執行使用 Visual Studio 2015 建置的 C++ 應用程式所必備的元件。&lt;/a&gt;&lt;br /&gt;
&lt;h2 class=&quot;x-hidden-focus&quot; style=&quot;background-color: white; border: 0px; box-sizing: inherit; color: #333333; font-family: wf_segoe-ui_light, &amp;quot;Segoe UI Light&amp;quot;, &amp;quot;Segoe WP Light&amp;quot;, wf_segoe-ui_normal, &amp;quot;Segoe UI&amp;quot;, Segoe, &amp;quot;Segoe WP&amp;quot;, Tahoma, Verdana, Arial, sans-serif; font-size: 22.5px; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-weight: normal; line-height: 1.25; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/8408699838778445745/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2019/01/api-ms-win-crt-runtime-l1-1-0dll.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8408699838778445745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8408699838778445745'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2019/01/api-ms-win-crt-runtime-l1-1-0dll.html' title='api-ms-win-crt-runtime-l1-1-0.dll'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEj6x1zEk6rTK2r2kQCSKAmL-hS3hyn8RdH-PZVwBxwNxq3wFInOOkKNzFxpDHhtcdQilypTpgocWXtv7XYeBXMwMGBvOUY2jYxNJ_l6bNKFoGJTAiSzfYE52Gj1BP7i_KlwJySNWMUYFs3Y/s72-c/123.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-1862180510255039954</id><published>2017-08-02T15:11:00.000+08:00</published><updated>2017-08-02T15:11:14.164+08:00</updated><title type='text'>ASP.NET 在 postback  後，所有 JavaScript 功能失效 </title><content type='html'>因為不常寫 webpage ，遇到這個事，還浪費了半天找資料測試。就像是，我也常常搞不懂&amp;nbsp;M$ &amp;nbsp;......&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWVfxWUTRwN01zpSzuBPvm0rDCweC4-3MJlR4krYMgTKaR-mD6FZ6i0XwVFibGqOkJXivlSqZypQN-GeKLjF1mf87axQiCaQSOx6XLTWO75GzP_JCN1TIT1OxIK6kjGZ20Sbpa63Ieo8pF/s1600/111.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;537&quot; data-original-width=&quot;984&quot; height=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWVfxWUTRwN01zpSzuBPvm0rDCweC4-3MJlR4krYMgTKaR-mD6FZ6i0XwVFibGqOkJXivlSqZypQN-GeKLjF1mf87axQiCaQSOx6XLTWO75GzP_JCN1TIT1OxIK6kjGZ20Sbpa63Ieo8pF/s400/111.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;原本按MOQ設定會彈出畫面&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;第一次執行都是正常的，但是一經過 postback 後，又像是，變調的戀情，回不去了~~&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
程式架構 &amp;nbsp;Master +&amp;nbsp;Content&amp;nbsp;+&amp;nbsp;UpdatePanel1&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;link href=&quot;../CSS/GrayWhiteModal.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;../JS/jquery.min.js&quot; type=&quot;text/javascript&quot; &amp;gt;&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;script src=&quot;../JS/GrayWhiteModal.js&quot; type=&quot;text/javascript&quot; /&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
處理方法&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
1. 在 &lt;span style=&quot;font-size: large;&quot;&gt;Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;.Load&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
加上&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;ScriptManager.RegisterStartupScript(Me, Page.GetType, &quot;Script&quot;, &quot;initAllEvent();&quot;, True)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red;&quot;&gt;PS.原來是 M$ 在 postback 後清掉了所有“異已” &amp;nbsp; &amp;gt;&quot;&amp;lt; &lt;/span&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.在自訂的 js 檔案中，把所有要初始化的事件寫在裡面&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;function initAllEvent() &lt;/span&gt;{&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;$(&quot;#btnMOQ&quot;).click(function () {&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SelectorDivShow(&quot;#divWhite1&quot;);&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; });&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;
&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;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/1862180510255039954/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2017/08/aspnet-postback-javascript.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/1862180510255039954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/1862180510255039954'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2017/08/aspnet-postback-javascript.html' title='ASP.NET 在 postback  後，所有 JavaScript 功能失效 '/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiWVfxWUTRwN01zpSzuBPvm0rDCweC4-3MJlR4krYMgTKaR-mD6FZ6i0XwVFibGqOkJXivlSqZypQN-GeKLjF1mf87axQiCaQSOx6XLTWO75GzP_JCN1TIT1OxIK6kjGZ20Sbpa63Ieo8pF/s72-c/111.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-2721220613106089553</id><published>2015-12-10T11:39:00.002+08:00</published><updated>2015-12-10T11:39:32.878+08:00</updated><title type='text'>.net 使用 osk 出現 無法啟動螢幕小鍵盤 的錯誤處理</title><content type='html'>&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpdpVdmpRNf1ziStOyR0FEgnrU5qf6GGNWKXI4O1YQB9iPwzw0ZvqS-hIBjmaHx-XLZ5d6iA0vg4td1x3sBwqbp-Rwwzb2KaovanCKQjmXbbOqyjGcuX48BT_O2KgUdSOZjLHIDnKHevHG/s1600/11111.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpdpVdmpRNf1ziStOyR0FEgnrU5qf6GGNWKXI4O1YQB9iPwzw0ZvqS-hIBjmaHx-XLZ5d6iA0vg4td1x3sBwqbp-Rwwzb2KaovanCKQjmXbbOqyjGcuX48BT_O2KgUdSOZjLHIDnKHevHG/s400/11111.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;程式寫好後，移到別台會出現的錯誤&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: white; color: #dd4b39; font-family: arial, sans-serif; font-size: x-small; line-height: 16px;&quot;&gt;Code Snip&lt;/span&gt;&lt;br /&gt;
#Region &quot;On Screen Keyboard&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private OSK As System.Diagnostics.Process&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Public Sub CloseKeyboard()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If OSK IsNot Nothing Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not OSK.HasExited Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OSK.Kill()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OSK.Close()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OSK = Nothing&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Public Sub OpenKeyboard()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If OSK Is Nothing OrElse OSK.HasExited Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OSK = Process.Start(&quot;C:\Windows\System32\osk.exe&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
#End Region&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYZ6QXHL_uwV3U9a7EQ0rkzdjubOmbZ61QBm82J2GtyQ-64YPbYzU1_4G8uTkCXxClk-xLRzUxuGGFebDHXv9ZdfjoRJw_MNjlMhVj3LLY71cgzqigRU_jn0TmwBAmtERrPEqGlvgKIcNx/s1600/22222.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYZ6QXHL_uwV3U9a7EQ0rkzdjubOmbZ61QBm82J2GtyQ-64YPbYzU1_4G8uTkCXxClk-xLRzUxuGGFebDHXv9ZdfjoRJw_MNjlMhVj3LLY71cgzqigRU_jn0TmwBAmtERrPEqGlvgKIcNx/s1600/22222.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;重新設定目標CPU 為 AnyCPU 就正常了&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/2721220613106089553/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/12/net-osk.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2721220613106089553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2721220613106089553'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/12/net-osk.html' title='.net 使用 osk 出現 無法啟動螢幕小鍵盤 的錯誤處理'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEgpdpVdmpRNf1ziStOyR0FEgnrU5qf6GGNWKXI4O1YQB9iPwzw0ZvqS-hIBjmaHx-XLZ5d6iA0vg4td1x3sBwqbp-Rwwzb2KaovanCKQjmXbbOqyjGcuX48BT_O2KgUdSOZjLHIDnKHevHG/s72-c/11111.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-7297002283596063311</id><published>2015-12-10T11:25:00.000+08:00</published><updated>2015-12-10T11:42:12.955+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>利用 MenuStrip 做多國語言的切換</title><content type='html'>相關的參考，在程式中有備註&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPmA4IHY2pQYgfq3Ta5JGEYJGKzB0aiIL2jB61GureQxK2a-b1qBYfNjXbcRJvNJMz7xEBHzZJFeELX84zU12cXSX5icNKWVA9anXo59sK9f32NEHmMa24yY9fTeVuyzXDrff1LBGj0hmq/s1600/00.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPmA4IHY2pQYgfq3Ta5JGEYJGKzB0aiIL2jB61GureQxK2a-b1qBYfNjXbcRJvNJMz7xEBHzZJFeELX84zU12cXSX5icNKWVA9anXo59sK9f32NEHmMa24yY9fTeVuyzXDrff1LBGj0hmq/s1600/00.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;初始畫面會先跑預設語言&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9ZQWFl7LkXcC1PjvgbRyS4Wjp8tx6IkzSVkjBnpC0zyDdYV9ykQa29OOjOSEhw7BYQNbJqS212pDYbTQ3ualOc3TKdW9Jkyn6U_ug5cYBtgtf_z_1JW0v2psZ03wN920AXI5nlaZ22tnB/s1600/0011.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9ZQWFl7LkXcC1PjvgbRyS4Wjp8tx6IkzSVkjBnpC0zyDdYV9ykQa29OOjOSEhw7BYQNbJqS212pDYbTQ3ualOc3TKdW9Jkyn6U_ug5cYBtgtf_z_1JW0v2psZ03wN920AXI5nlaZ22tnB/s1600/0011.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;選擇語言檔設定的語系&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdpxuhDzdey4IuukkXVrzHk7rA7ZOTU1D2_ux30I-wOMZXft-gzviTFqLWh_nL-19-xDziB8VLgH6t6FR1e0GZemPeVkIyCMFcuFiKX4H1iL9V6OFldzW4yZ2yprSER3ATaUcIDoYw6Klv/s1600/11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdpxuhDzdey4IuukkXVrzHk7rA7ZOTU1D2_ux30I-wOMZXft-gzviTFqLWh_nL-19-xDziB8VLgH6t6FR1e0GZemPeVkIyCMFcuFiKX4H1iL9V6OFldzW4yZ2yprSER3ATaUcIDoYw6Klv/s1600/11.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;語言檔的內容設定&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;divScrollAuto&quot;&gt;
&lt;em style=&quot;background-color: white; color: #dd4b39; font-family: arial, sans-serif; font-size: small; font-style: normal; line-height: 16px;&quot;&gt;Code Snip&lt;/em&gt;&lt;br /&gt;
Public Class frmMain&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MenuStrip1.Font = New Font(&quot;arial&quot;, 10)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsLanguage.Font = New Font(&quot;arial&quot;, 10)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim lines As String() = StrArr()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To lines.Length - 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Mid(lines(i), 3, 1) = &quot;-&quot; Then tsLanguage.Items.Add(lines(i))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsLanguage.SelectedIndex = 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &#39;轉換語系&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Sub tsLanguage_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles tsLanguage.SelectedIndexChanged&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me.Cursor = Cursors.WaitCursor&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;獲得語系檔&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim lines As String() = StrArr()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To lines.Length - 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;比對語系所在列數&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If tsLanguage.SelectedItem = lines(i) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;底下程式太長太亂，另開副程序開始置換&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CollectionCtrl(lines, i + 1)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Me.Cursor = Cursors.Default&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Sub CollectionCtrl(ByVal lines() As String, ByVal CurRow As Integer)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;置換迴圈&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = CurRow To lines.Length - 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;直到檔尾或下一個語系：例 en-us 的 &quot;-&quot; 請不要更改&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Mid(lines(i), 3, 1) = &quot;-&quot; Then Exit Sub&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;搜尋表單上的控制項&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each ctrl As Control In Controls&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;語系檔該行空白不比對&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If lines(i) &amp;lt;&amp;gt; Nothing Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Select Case ctrl.Name&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;由於物件特性，底下物件必須遞迴才能找到&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Case &quot;MenuStrip1&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim ts As ToolStrip = CType(ctrl, ToolStrip)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For j As Integer = 0 To ts.Items.Count - 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsRecursive(ts.Items(j), lines, i)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Case Else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If ctrl.Tag = Trim(Split(lines(i), &quot;=&quot;)(0)) Then _&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ctrl.Text = Trim(Split(lines(i), &quot;=&quot;)(1))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Select&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Sub tsRecursive(ByVal tsmi As ToolStripMenuItem, ByVal lines() As String, ByVal CurRow As Integer)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; On Error Resume Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If tsmi.Tag = Trim(Split(lines(CurRow), &quot;=&quot;)(0)) Then _&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tsmi.Text = Trim(Split(lines(CurRow), &quot;=&quot;)(1))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;遞迴&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To tsmi.DropDownItems.Count - 1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tsRecursive(tsmi.DropDownItems(i), lines, CurRow + 1)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Function StrArr() As String()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;語系檔在相對目錄 \language\bin\Debug\&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim txtReader As IO.StreamReader = IO.File.OpenText(Application.StartupPath &amp;amp; &quot;\Language.ini&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim fileContents As String = txtReader.ReadToEnd()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txtReader.Close()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return Split(fileContents, Environment.NewLine)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Function&lt;br /&gt;
End Class&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/7297002283596063311/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/12/menustrip.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/7297002283596063311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/7297002283596063311'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/12/menustrip.html' title='利用 MenuStrip 做多國語言的切換'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiPmA4IHY2pQYgfq3Ta5JGEYJGKzB0aiIL2jB61GureQxK2a-b1qBYfNjXbcRJvNJMz7xEBHzZJFeELX84zU12cXSX5icNKWVA9anXo59sK9f32NEHmMa24yY9fTeVuyzXDrff1LBGj0hmq/s72-c/00.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-2576180343584415016</id><published>2015-12-10T11:23:00.000+08:00</published><updated>2015-12-10T11:23:26.333+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>asp 的 session 轉到 aspx 可用的 session</title><content type='html'>在條件限制不能使用 cookie 的情況下&lt;br /&gt;
IIS 中的虛擬目錄 Session 無法共用&lt;br /&gt;
就算在相同目錄 asp 與 aspx 也無法共用&lt;br /&gt;
考慮安全性與便利性&lt;br /&gt;
&lt;br /&gt;
利用 asp 將所有的 Session 使用 Form Post 的方法傳遞給 aspx 的程式&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;aspSession.asp&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;-----------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;title&amp;gt;ASP Session&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;%&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.CodePage = 65001&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.CharSet = &quot;utf-8&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;&amp;lt;FORM name=trans id=trans action=aspxSession.aspx method=post &amp;gt;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each Item &amp;nbsp;In Session.Contents&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Item &amp;lt;&amp;gt; &quot;SYS_MailSender&quot; then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;&amp;lt;input type=hidden name=&quot; &amp;amp; Item)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write( &quot; value=&quot; &amp;amp; Session(item) &amp;amp; &quot; &amp;gt;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Response.Redirect(&quot;aspxSession.aspx?target=&quot; + Session(item))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;&amp;lt;/FORM&amp;gt;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Write(&quot;&amp;lt;scr&quot; + &quot;ipt&amp;gt;trans.submit();&amp;lt;/scr&quot; + &quot;ipt&amp;gt;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;-----------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
再由 aspx 的程式重新設定 Session&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;aspxSession.aspx.vb
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;-----------------------------------------------&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;Public Class aspxSession&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; Inherits System.Web.UI.Page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &#39; ASP 寫進的 Session 必須要在這轉成 ASP.NET&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &#39;本來要用 Request.QueryString 來處理的&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &#39;後來考慮安全性，所以用aspSession.asp/Form Action 的方式&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Session(&quot;Emp_Id&quot;) = Request.QueryString(&quot;target&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For i As Integer = 0 To Request.Form.Count - 1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Session(Request.Form.GetKey(i)) = Request.Form(i)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Session(&quot;Emp_Id&quot;) = &quot;&quot; Then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Redirect(&quot;~/&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Response.Redirect(&quot;~/eFormQuot/undertake.aspx&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;End Class&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #ea9999;&quot;&gt;-----------------------------------------------&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/2576180343584415016/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/12/asp-session-aspx-session.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2576180343584415016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2576180343584415016'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/12/asp-session-aspx-session.html' title='asp 的 session 轉到 aspx 可用的 session'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-516612314338000648</id><published>2015-03-27T11:24:00.001+08:00</published><updated>2015-03-27T11:24:43.358+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>把四四方方的控制項，弄得圓圓的美化方法</title><content type='html'>在一開始往下的時候，一定要先看&lt;a href=&quot;https://msdn.microsoft.com/zh-tw/library/system.windows.forms.control.region(v=vs.110).aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: blue; font-size: large;&quot;&gt; Control.Region 屬性&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
MSDN裡面有示範程式，我就不現醜了 &amp;nbsp;=.=&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRYJCkPfzmNHqlDoblqazIldz4u7A1rIMwnaZBKDoAf_sFYyoQHyon_XVxPpsbZrzJRao_lDyYlp_j9TATm4WjAsocWBUgepUwuzTtpnDRhxiMjNkI0aZhkHElGzxeCzHObGT7OUo2U_qa/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRYJCkPfzmNHqlDoblqazIldz4u7A1rIMwnaZBKDoAf_sFYyoQHyon_XVxPpsbZrzJRao_lDyYlp_j9TATm4WjAsocWBUgepUwuzTtpnDRhxiMjNkI0aZhkHElGzxeCzHObGT7OUo2U_qa/s1600/1.png&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;雖然，這些 button 也不會真的很難看&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;float: left; margin-right: 1em; text-align: left;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPH8AbhZPQvBEaxVORE_Z8fO0EP_GPIOdh7v9OG0fs7jQJcdrlKhqiC31GgcPq8K6ZHPnNnWDT864OoHqqTHnob0CW5MgnXz2xSpStOn4NiY0X3BXZKyPwgKmnBrsK743lKN94RNql0KMu/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPH8AbhZPQvBEaxVORE_Z8fO0EP_GPIOdh7v9OG0fs7jQJcdrlKhqiC31GgcPq8K6ZHPnNnWDT864OoHqqTHnob0CW5MgnXz2xSpStOn4NiY0X3BXZKyPwgKmnBrsK743lKN94RNql0KMu/s1600/2.png&quot; height=&quot;254&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;但很明顯的，美化後真的太視覺系了&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/516612314338000648/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post_36.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/516612314338000648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/516612314338000648'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post_36.html' title='把四四方方的控制項，弄得圓圓的美化方法'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEjRYJCkPfzmNHqlDoblqazIldz4u7A1rIMwnaZBKDoAf_sFYyoQHyon_XVxPpsbZrzJRao_lDyYlp_j9TATm4WjAsocWBUgepUwuzTtpnDRhxiMjNkI0aZhkHElGzxeCzHObGT7OUo2U_qa/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-2759129057561400300</id><published>2015-03-27T10:56:00.000+08:00</published><updated>2015-03-27T11:02:14.259+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>控制項在多執行緒出現錯誤</title><content type='html'>如果在使用 多執行緒(&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Microsoft JhengHei UI&#39;, &#39;Microsoft JhengHei&#39;, PMingLiU, MingLiU, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Multithreaded&lt;/span&gt;&lt;span style=&quot;color: #2a2a2a; font-family: &#39;Microsoft JhengHei UI&#39;, &#39;Microsoft JhengHei&#39;, PMingLiU, MingLiU, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;) 時，&lt;br /&gt;
想把執行後的資料回傳到表單上的控制項，&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: large;&quot;&gt;除了 &lt;a href=&quot;https://msdn.microsoft.com/zh-tw/library/900fyy8e.aspx&quot; target=&quot;_blank&quot;&gt;委派(delegate)&lt;/a&gt; 或 &lt;a href=&quot;https://msdn.microsoft.com/zh-tw/library/ywkkz4s1.aspx&quot; target=&quot;_blank&quot;&gt;使用 BackgroundWorker 元件&lt;/a&gt;&amp;nbsp;之外，&lt;/span&gt;&lt;br /&gt;
最快的方式，應該是直接在&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;form load 的事件中，加上&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: large;&quot;&gt;Form.CheckForIllegalCrossThreadCalls = False&lt;/span&gt;。&lt;br /&gt;
但是MSDN上的備註裡，也提醒&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://msdn.microsoft.com/zh-tw/library/system.windows.forms.control.checkforillegalcrossthreadcalls%28v=vs.110%29.aspx&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Control.CheckForIllegalCrossThreadCalls&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: red; font-size: large;&quot;&gt;&quot;&lt;span class=&quot;sentence&quot; data-guid=&quot;4b744a9255272694a1710cab7d727f6d&quot; data-source=&quot;When a thread other than the creating thread of a control tries to access one of that control&#39;s methods or properties, it often leads to unpredictable results.&quot; id=&quot;mt3&quot; style=&quot;font-family: &#39;Microsoft JhengHei UI&#39;, &#39;Microsoft JhengHei&#39;, PMingLiU, MingLiU, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px;&quot; xml:space=&quot;preserve&quot;&gt;當控制項的建立執行緒以外的執行緒嘗試存取該控制項的其中一個方法或屬性時，它通常會導致無法預期的結果。&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Microsoft JhengHei UI&#39;, &#39;Microsoft JhengHei&#39;, PMingLiU, MingLiU, &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; line-height: 18px;&quot;&gt;&amp;nbsp;&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
所以，是要用還是不要用?????? &amp;nbsp;那就見人見智了!!!!!!!!&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/2759129057561400300/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post_27.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2759129057561400300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2759129057561400300'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post_27.html' title='控制項在多執行緒出現錯誤'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-2799604102348638905</id><published>2015-03-26T18:03:00.001+08:00</published><updated>2015-03-26T21:19:50.571+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>如何 在 .net 的工具箱顯示 Advantech USB 4751L  的控制項</title><content type='html'>這個標題其實下的不好~~&lt;br /&gt;
&lt;br /&gt;
前天同事在問，自動量測儀器中，有一台研華的IO卡，&lt;br /&gt;
為什麼沒辦法在 .net 的工具箱，看到相關的控制項。&lt;br /&gt;
想了很久，因為這個程式是去年寫好的，所以......&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKhB3fYbagiPJzxIYuq2wg9jMtcALfyOP32qyZzxU4hJvmkGPelXNEAavV7eRz2keq4nJhyphenhyphen3408oGpiADBYwU3k-VR6WNII3t-0paP58qC77fzp-k8l4PNKRVOhA9yIfWOk-6mA8Ph3lIE/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKhB3fYbagiPJzxIYuq2wg9jMtcALfyOP32qyZzxU4hJvmkGPelXNEAavV7eRz2keq4nJhyphenhyphen3408oGpiADBYwU3k-VR6WNII3t-0paP58qC77fzp-k8l4PNKRVOhA9yIfWOk-6mA8Ph3lIE/s1600/1.png&quot; height=&quot;166&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
為了預防我自已又忘了，開始嗡嗡嗡&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyyYxK9c8JCTBFkkz4HW_LZblbzuj3d8rCiIFjhbvTQ2x7kQvhtkRmKHXz7lQN-631jNQp_WUovbneyL7s5QwrPwT0PlMv2zoadnmH2ugjdoBY94Ah-DfAsxQYb06UUevbsAltR-kyuLT/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAyyYxK9c8JCTBFkkz4HW_LZblbzuj3d8rCiIFjhbvTQ2x7kQvhtkRmKHXz7lQN-631jNQp_WUovbneyL7s5QwrPwT0PlMv2zoadnmH2ugjdoBY94Ah-DfAsxQYb06UUevbsAltR-kyuLT/s1600/2.png&quot; height=&quot;200&quot; width=&quot;187&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;1.選定頁籤後，在空白處按滑鼠右鍵&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0OJtrnpVaGuVBfHDF16qMsDgkCME3_ILqClZxTNQ1rLXYgKBrMtDXfW8LGa5425VVxNTat068qNjnlAhHrNW5hIFsZHB6_lEzsKeWW1_DxUvldF9X3CY8QpcDmsovs81T_s7VgdzwNvs5/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0OJtrnpVaGuVBfHDF16qMsDgkCME3_ILqClZxTNQ1rLXYgKBrMtDXfW8LGa5425VVxNTat068qNjnlAhHrNW5hIFsZHB6_lEzsKeWW1_DxUvldF9X3CY8QpcDmsovs81T_s7VgdzwNvs5/s1600/3.png&quot; height=&quot;200&quot; width=&quot;135&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;2.選擇項目&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxoAVgkUeYriQhhijV8XdiwhPVydFho0Ly-PuSIY0sxHVSRcaI7hd4MKhZ509i0hk-HpyABOwaSGMZBj_tTeDa4EHSUxpAzvuw3DYlZajSDuJSpij_WxagZu-1du4ps7fpudl7hlf-0_J/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTxoAVgkUeYriQhhijV8XdiwhPVydFho0Ly-PuSIY0sxHVSRcaI7hd4MKhZ509i0hk-HpyABOwaSGMZBj_tTeDa4EHSUxpAzvuw3DYlZajSDuJSpij_WxagZu-1du4ps7fpudl7hlf-0_J/s1600/4.png&quot; height=&quot;155&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;3.瀏灠檔案後，選擇 windows \ system32 \ automation.dbaq.dll&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwllvhyrZXT0hxL8reUNGpW-wLxMwCZnjKFAXkWxzWc_k_wnJVYQSwBILU7Px4wNWO4P8vgWHwFsDApNsgqnfF-Pm9WKzMY6snz5oCrDE35g04WbMN69z5hNOxet7IsJArLKvnpufWo74n/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwllvhyrZXT0hxL8reUNGpW-wLxMwCZnjKFAXkWxzWc_k_wnJVYQSwBILU7Px4wNWO4P8vgWHwFsDApNsgqnfF-Pm9WKzMY6snz5oCrDE35g04WbMN69z5hNOxet7IsJArLKvnpufWo74n/s1600/6.png&quot; height=&quot;200&quot; width=&quot;141&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/2799604102348638905/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/03/net-advantech-usb-4751l.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2799604102348638905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/2799604102348638905'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/03/net-advantech-usb-4751l.html' title='如何 在 .net 的工具箱顯示 Advantech USB 4751L  的控制項'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiKhB3fYbagiPJzxIYuq2wg9jMtcALfyOP32qyZzxU4hJvmkGPelXNEAavV7eRz2keq4nJhyphenhyphen3408oGpiADBYwU3k-VR6WNII3t-0paP58qC77fzp-k8l4PNKRVOhA9yIfWOk-6mA8Ph3lIE/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-4996140355133559262</id><published>2015-03-26T17:39:00.001+08:00</published><updated>2015-03-26T17:39:02.271+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>檢查遠端主機是否連線與反應時間</title><content type='html'>以前連接遠端主機前，都會先檢查主機是否正常。&lt;br /&gt;
在程式裡會加上 My.Computer.Network.Ping(host) 判斷。&lt;br /&gt;
但有時網路頻寬常常會不穩定，所以必須加上一些參數來參考。&lt;br /&gt;
&lt;br /&gt;
最先想到這個&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyTePd-O-b92M_p_nHAW8rKSWK6XFL_lh4_DDX25OwcRi0AYcrstVvkft2l6A_yLAccDlccnEkabPlXgJmp3EOoOhhCTtvCbQmjj3bq22QfoHcvDZjRG-UihGXommq16Bxd0SO-zOx1DIe/s1600/pi.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyTePd-O-b92M_p_nHAW8rKSWK6XFL_lh4_DDX25OwcRi0AYcrstVvkft2l6A_yLAccDlccnEkabPlXgJmp3EOoOhhCTtvCbQmjj3bq22QfoHcvDZjRG-UihGXommq16Bxd0SO-zOx1DIe/s1600/pi.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
但我嫌他太麻煩了，還要拆文字檔才能得到結果。&lt;br /&gt;
所以又換了一個方法，還不錯用，給各位參考。&lt;br /&gt;
&lt;br /&gt;
&#39;伺服器的反應時間&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Private Sub PingRoundTime(ByVal host As String, ByVal size As String)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim PingSVR As New Ping&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim InfoSVR As PingReply&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim Buff(size) As Byte&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InfoSVR = PingSVR.Send(host, 1000, Buff)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With InfoSVR&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If .Status = IPStatus.Success Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(.RoundtripTime.ToString)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(.Status.ToString)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch ex As Exception&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(ex.Message)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/4996140355133559262/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4996140355133559262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4996140355133559262'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/03/blog-post.html' title='檢查遠端主機是否連線與反應時間'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEgyTePd-O-b92M_p_nHAW8rKSWK6XFL_lh4_DDX25OwcRi0AYcrstVvkft2l6A_yLAccDlccnEkabPlXgJmp3EOoOhhCTtvCbQmjj3bq22QfoHcvDZjRG-UihGXommq16Bxd0SO-zOx1DIe/s72-c/pi.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-5718932418134130002</id><published>2015-03-04T15:42:00.000+08:00</published><updated>2015-03-04T15:42:16.734+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>SQLite 新嘗試</title><content type='html'>寫程式做資料統計有很多年了，要用&amp;nbsp;SQLite 來紀錄，還是頭一回。&lt;br /&gt;
先分享官網下載的網頁&amp;nbsp;&amp;nbsp;&lt;a href=&quot;http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki&quot;&gt;System.Data.SQLite Downloads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;至於UI 的操作，個人覺得&amp;nbsp;&lt;a href=&quot;http://sqlitebrowser.org/&quot;&gt;DB Browser for SQLite&lt;/a&gt;&amp;nbsp;很好用。&lt;br /&gt;&lt;br /&gt;以上請依據作業系統，選擇合適的版本下載使用吧！&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/5718932418134130002/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2015/03/sqlite.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/5718932418134130002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/5718932418134130002'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2015/03/sqlite.html' title='SQLite 新嘗試'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-3648014907513002537</id><published>2014-04-23T14:04:00.000+08:00</published><updated>2014-04-23T14:04:10.208+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>asp.net 網頁生命週期</title><content type='html'>&lt;div&gt;
網頁載入事件的順序，詳情請參考圖的來源 &amp;nbsp;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx&quot; target=&quot;_blank&quot;&gt;asp.net page life cycle.&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9yxLklpioKKrRzz0WgEwbd2D0qyjpb410AT9wJVZ5Rxld7mpHVAO-yFjerj5jz8kbiur3RhfN70jbj5lIyFPoOjCXSCCoABglzGEyxQWmqVpMfCCWPEEV9YU055WBOJEFOQp56tCabXNN/s1600/PageLifeCycle.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9yxLklpioKKrRzz0WgEwbd2D0qyjpb410AT9wJVZ5Rxld7mpHVAO-yFjerj5jz8kbiur3RhfN70jbj5lIyFPoOjCXSCCoABglzGEyxQWmqVpMfCCWPEEV9YU055WBOJEFOQp56tCabXNN/s1600/PageLifeCycle.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/3648014907513002537/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2014/04/aspnet.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3648014907513002537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3648014907513002537'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2014/04/aspnet.html' title='asp.net 網頁生命週期'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEj9yxLklpioKKrRzz0WgEwbd2D0qyjpb410AT9wJVZ5Rxld7mpHVAO-yFjerj5jz8kbiur3RhfN70jbj5lIyFPoOjCXSCCoABglzGEyxQWmqVpMfCCWPEEV9YU055WBOJEFOQp56tCabXNN/s72-c/PageLifeCycle.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-4681484671732708383</id><published>2014-04-15T21:52:00.000+08:00</published><updated>2014-04-16T10:29:39.150+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>List all Microsoft SQL Server / Instance Names</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-CMBK84Ayxhk6J0B4oaW1FASlXfLLCHGGlGD_7kxm4Yb9a-2LhhxbxPLgArgiV6vOg-K6owxbKoeQTOae8fjrIX8WTJFXVpZSPY4Tda97ekhmP23wQiuowE6GYGZp-FTkk3_cDppVcBGv/s1600/33.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-CMBK84Ayxhk6J0B4oaW1FASlXfLLCHGGlGD_7kxm4Yb9a-2LhhxbxPLgArgiV6vOg-K6owxbKoeQTOae8fjrIX8WTJFXVpZSPY4Tda97ekhmP23wQiuowE6GYGZp-FTkk3_cDppVcBGv/s1600/33.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small; text-align: start;&quot;&gt;查出在一台伺服器中，同時安裝多少個執行個體（Instance）&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
最近開發 &lt;a href=&quot;http://www.knx.org/&quot; target=&quot;_blank&quot;&gt;KONNEX (KNX)&lt;/a&gt;相關的程式，這個協會有提供特定的軟體給使用者設定並開發，其中也會安裝資訊庫。如果要自動設定 physical address 就必須讀取相關的 firmware info. &amp;nbsp;又要配合專案......唉，真是一言難盡。&lt;br /&gt;
以下是針對未來使用者可藉由不同的執行個體(Instance)名稱，作為存取資料庫系統依據的程式碼&lt;br /&gt;
-----------------------------------------------------------&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Sub ScanSQLInstance()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;指定在 64 位元作業系統上以哪個登錄檢視為目標&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim RV As RegistryView&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not Registry.LocalMachine.OpenSubKey(&quot;SOFTWARE\Wow6432Node&quot;) Is Nothing Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RV = RegistryView.Registry64&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RV = RegistryView.Registry32&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;登錄機碼節點&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim baseKey As RegistryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RV)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;節點下的子機碼&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim key As RegistryKey = baseKey.OpenSubKey(&quot;SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ListBox1.Items.Add(key.Name)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ListBox1.Items.Add(&quot;-----------------------------------------------&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;列出所有機碼名稱的字串陣列&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; For Each s As String In key.GetValueNames()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ListBox1.Items.Add(s)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Next&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;收工 &amp;nbsp;^^&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; key.Close()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; baseKey.Close()&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;strong style=&quot;background-color: #dfe9ff; color: #666666; font-family: Verdana, Arial, Helvetica, sans-serif, 細明體; font-size: 12px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;搜尋含區域網路內sql執行個體&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
Using System.Data.Sql&lt;br /&gt;
&lt;br /&gt;
Dim sqlServer As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance&lt;br /&gt;
Dim db As DataTable = sqlServer.GetDataSources()&lt;br /&gt;
Dim Name As String() = New String(db.Rows.Count - 1) {}&lt;br /&gt;
For i As Integer = 0 To db.Rows.Count - 1&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Name(i) = db.Rows(i)(0).ToString() + db.Rows(i)(1).ToString().Trim()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;toolStripTextBox1.Items.Add(Name(i))&lt;br /&gt;
Next&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/4681484671732708383/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2014/04/list-all-microsoft-sql-server-instance.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4681484671732708383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4681484671732708383'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2014/04/list-all-microsoft-sql-server-instance.html' title='List all Microsoft SQL Server / Instance Names'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEj-CMBK84Ayxhk6J0B4oaW1FASlXfLLCHGGlGD_7kxm4Yb9a-2LhhxbxPLgArgiV6vOg-K6owxbKoeQTOae8fjrIX8WTJFXVpZSPY4Tda97ekhmP23wQiuowE6GYGZp-FTkk3_cDppVcBGv/s72-c/33.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-3302826806191330609</id><published>2014-04-11T14:25:00.000+08:00</published><updated>2014-04-16T11:05:35.407+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB.NET"/><title type='text'>VB.NET ComboBox 模糊查詢下拉式選單</title><content type='html'>&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5jL1XyUEUk_GHZkY0G0DZFOhMF4AWGIlArXjTwQZ71pPFOpQzcK823j0reISZw5R17k1zV2uM7GW7mu5YiXL-q2-L818izBzA7tZs5ktwkof4eZKSUbCyPQ2k9OT2-DyUgK2HY0TaPMMe/s1600/2013-05-10_131949.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5jL1XyUEUk_GHZkY0G0DZFOhMF4AWGIlArXjTwQZ71pPFOpQzcK823j0reISZw5R17k1zV2uM7GW7mu5YiXL-q2-L818izBzA7tZs5ktwkof4eZKSUbCyPQ2k9OT2-DyUgK2HY0TaPMMe/s1600/2013-05-10_131949.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;下拉選單&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipBfd2FuzthGGE_7IUzRS-roIMGfnVX53N0oWzwTK-kWqlkgLIGYAFR5Q5SrXviVfcmhcDJGSSXRivikHmoGNkWgmcwErSS-DmWju53On79j5PSfJsvKoqRTZaxuutOqAjpZUAS7xo7pNU/s1600/2013-05-10_132059.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipBfd2FuzthGGE_7IUzRS-roIMGfnVX53N0oWzwTK-kWqlkgLIGYAFR5Q5SrXviVfcmhcDJGSSXRivikHmoGNkWgmcwErSS-DmWju53On79j5PSfJsvKoqRTZaxuutOqAjpZUAS7xo7pNU/s1600/2013-05-10_132059.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;可模糊查詢的下拉選單&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim authors As New AutoCompleteStringCollection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With authors&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Keelung&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Taipei&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Taoyuan&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Hsinchu&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Miaoli&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Taichung&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Changhua&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Nantou&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Chiayi&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Yunlin&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Tainan&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Kaohsiung&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Pingtung&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Taitung&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Hualien&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Add(&quot;Ilan&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; With ComboBox1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AutoCompleteMode = AutoCompleteMode.Suggest&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AutoCompleteSource = AutoCompleteSource.CustomSource&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .AutoCompleteCustomSource = authors&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .DataSource = authors&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .SelectedIndex = -1&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End With&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/3302826806191330609/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2014/04/vbnet-combobox.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3302826806191330609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/3302826806191330609'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2014/04/vbnet-combobox.html' title='VB.NET ComboBox 模糊查詢下拉式選單'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEi5jL1XyUEUk_GHZkY0G0DZFOhMF4AWGIlArXjTwQZ71pPFOpQzcK823j0reISZw5R17k1zV2uM7GW7mu5YiXL-q2-L818izBzA7tZs5ktwkof4eZKSUbCyPQ2k9OT2-DyUgK2HY0TaPMMe/s72-c/2013-05-10_131949.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-5071803411938415397</id><published>2014-04-11T13:56:00.001+08:00</published><updated>2014-04-11T14:04:10.879+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'> GridView 固定標題列與凍結欄位</title><content type='html'>配合鼎新的 ERP 做好一個報價功能的網頁&lt;br /&gt;
結果發現單身的部份如果要將標題列凍結
還要寫很久~~~&lt;br /&gt;
&lt;br /&gt;
晚上找了G大神搜尋了一下 &amp;nbsp;嘿嘿嘿 &amp;nbsp;^^&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJeXgVia90ITNGU4GUMeRFYBOG_1gvi3PgSeJjJYKasDUnWL-8qvYwWIlkK-ngBfcGr9473SSRW6GwU8g30mwT96Uu7zqquI-LmKQZX5_89JFymXk2lhBhLbNEl8PFPeLSlbkVjw6PEAJl/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJeXgVia90ITNGU4GUMeRFYBOG_1gvi3PgSeJjJYKasDUnWL-8qvYwWIlkK-ngBfcGr9473SSRW6GwU8g30mwT96Uu7zqquI-LmKQZX5_89JFymXk2lhBhLbNEl8PFPeLSlbkVjw6PEAJl/s1600/2.jpg&quot; height=&quot;328&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;很輕鬆的就把gridview 標題列凍結了&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
gridview 標題列凍結程式請參考 &amp;nbsp;&lt;a href=&quot;http://gridviewscroll.aspcity.idv.tw/Demo.aspx&quot; target=&quot;_blank&quot;&gt;gridviewscroll Demo&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/5071803411938415397/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2014/04/gridview.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/5071803411938415397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/5071803411938415397'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2014/04/gridview.html' title=' GridView 固定標題列與凍結欄位'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEhJeXgVia90ITNGU4GUMeRFYBOG_1gvi3PgSeJjJYKasDUnWL-8qvYwWIlkK-ngBfcGr9473SSRW6GwU8g30mwT96Uu7zqquI-LmKQZX5_89JFymXk2lhBhLbNEl8PFPeLSlbkVjw6PEAJl/s72-c/2.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-8047419247705982849</id><published>2014-04-11T10:48:00.000+08:00</published><updated>2014-04-11T14:18:22.064+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Office"/><title type='text'>Excel 專案工作日計算與預估</title><content type='html'>工作上須要紀錄專案起始日、到期日與完成率，並自動推算未完成的專案，會在什麼時候完成。&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyfCmRGV7q4wO_LhfK78jCnOgskfOOntAINfRtFWtUDDZQ9cRIK6pcUAgyZQgbcYWTXxl5KLunmyFshUo6P5X6E7J7QEEje6Tj1jnF1DhPbOutjoz3bQvXyQZD64EnH60J6S8-EpxqdZGx/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyfCmRGV7q4wO_LhfK78jCnOgskfOOntAINfRtFWtUDDZQ9cRIK6pcUAgyZQgbcYWTXxl5KLunmyFshUo6P5X6E7J7QEEje6Tj1jnF1DhPbOutjoz3bQvXyQZD64EnH60J6S8-EpxqdZGx/s1600/1.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Excel 2003&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
函數設計：&lt;span style=&quot;color: red;&quot;&gt;1.設定一個重啟的基礎日&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.計算出原本用掉的天數與完成率的比&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.求出2.再乘與未完成率得到剩餘工作天&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.求出3.與重起日相加&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
計算日曆天 E1 &amp;nbsp;=&lt;span style=&quot;color: red;&quot;&gt;D2+ DATEDIF(A2,B2,&quot;D&quot;)/C2*(1-C2)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
計算工作天 E3 &amp;nbsp;=&lt;span style=&quot;color: red;&quot;&gt;WORKDAY(D2,NETWORKDAYS(A2,B2)/C2*(1-C2))&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
如果要扣掉工作天，必須使用 &amp;nbsp;WORKDAY &amp;nbsp;與 &amp;nbsp;NETWORKDAYS&lt;br /&gt;
請記得引用&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4IYllAzsDSyogSATdz_SlygiAmnqwTn2ZzeKaZkUjXWHzTpxBO9gPZNeFnAP5A98V9tZjyBS3rs-4c8nJlI1nocYbCJtyPcXGNMIIgsMhdLbz82aQu10b9GDqWXDjxMZrhQOwVfZImt6/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHP81vm1wYH3GR1es0DdPSnKFFhPhTn0NSnCyaII4xW8HloohHksrnhZuyaakk8Emn_K2kNPrJuYsbwsa5HJGxgLiC1D54kAKYUNPJxWUCGhzskkQHl3vruEObb9EOt9Dv_nXQwyhbs7dx/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHP81vm1wYH3GR1es0DdPSnKFFhPhTn0NSnCyaII4xW8HloohHksrnhZuyaakk8Emn_K2kNPrJuYsbwsa5HJGxgLiC1D54kAKYUNPJxWUCGhzskkQHl3vruEObb9EOt9Dv_nXQwyhbs7dx/s1600/2.jpg&quot; /&gt;&lt;/a&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4IYllAzsDSyogSATdz_SlygiAmnqwTn2ZzeKaZkUjXWHzTpxBO9gPZNeFnAP5A98V9tZjyBS3rs-4c8nJlI1nocYbCJtyPcXGNMIIgsMhdLbz82aQu10b9GDqWXDjxMZrhQOwVfZImt6/s1600/3.jpg&quot; height=&quot;320&quot; width=&quot;258&quot; /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4IYllAzsDSyogSATdz_SlygiAmnqwTn2ZzeKaZkUjXWHzTpxBO9gPZNeFnAP5A98V9tZjyBS3rs-4c8nJlI1nocYbCJtyPcXGNMIIgsMhdLbz82aQu10b9GDqWXDjxMZrhQOwVfZImt6/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Blogger automated replacement: &quot;https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2F4.bp.blogspot.com%2F-I5ngOXYHUzU%2FU0ZkOePochI%2FAAAAAAAAArg%2F_OGwEnCR5X0%2Fs1600%2F3.jpg&amp;amp;container=blogger&amp;amp;gadget=a&amp;amp;rewriteMime=image%2F*&quot; with &quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP4IYllAzsDSyogSATdz_SlygiAmnqwTn2ZzeKaZkUjXWHzTpxBO9gPZNeFnAP5A98V9tZjyBS3rs-4c8nJlI1nocYbCJtyPcXGNMIIgsMhdLbz82aQu10b9GDqWXDjxMZrhQOwVfZImt6/s1600/3.jpg&quot; --&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/8047419247705982849/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2014/04/excel.html#comment-form' title='6 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8047419247705982849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8047419247705982849'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2014/04/excel.html' title='Excel 專案工作日計算與預估'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEiyfCmRGV7q4wO_LhfK78jCnOgskfOOntAINfRtFWtUDDZQ9cRIK6pcUAgyZQgbcYWTXxl5KLunmyFshUo6P5X6E7J7QEEje6Tj1jnF1DhPbOutjoz3bQvXyQZD64EnH60J6S8-EpxqdZGx/s72-c/1.jpg" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3668391560306792513.post-4338750671908806141</id><published>2013-05-10T15:24:00.001+08:00</published><updated>2013-05-10T15:24:21.488+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript"/><title type='text'>JavaScript 網頁執行時，重新定義大小並置中</title><content type='html'>在 head 加上&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;pst.js&quot; &amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
在&amp;nbsp;pst.js(或是直接寫在&amp;nbsp;head 也是可以啦 &amp;nbsp;^^&quot; )&lt;br /&gt;
function window.onload() {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; reSize(1024, 600);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function reSize(x, y) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (x &amp;gt; screen.availWidth) x = screen.availWidth&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if (y &amp;gt; screen.availHeight) y = screen.availHeight&lt;br /&gt;
&amp;nbsp; &amp;nbsp; self.moveTo((screen.availWidth - x) / 2, (screen.availHeight - y) / 2);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; self.resizeTo(x, y);&lt;br /&gt;
}&lt;br /&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/4338750671908806141/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2013/05/javascript.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4338750671908806141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/4338750671908806141'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2013/05/javascript.html' title='JavaScript 網頁執行時，重新定義大小並置中'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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-3668391560306792513.post-8205662883235768312</id><published>2013-04-24T12:04:00.001+08:00</published><updated>2013-04-24T13:42:37.913+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>ASP.NET Calendar 隱藏的問題(必須要有物件)</title><content type='html'>本來單純的想說&lt;br /&gt;
簡單的做一下日期控制&lt;br /&gt;
應該不用Ajax&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5tzBuwTyWBo3E19PPmHp94Iy6c4L30nDEK10kuxL15G61pXLsu4ccPnxTUZh1VBlk7DpZPysY9QKw9HeJhkp7Jzi38z248TuxzJOpnkeVk5mc6MyFRZ2-SSkj2TPle2nU1bQ803EVxWpM/s1600/11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5tzBuwTyWBo3E19PPmHp94Iy6c4L30nDEK10kuxL15G61pXLsu4ccPnxTUZh1VBlk7DpZPysY9QKw9HeJhkp7Jzi38z248TuxzJOpnkeVk5mc6MyFRZ2-SSkj2TPle2nU1bQ803EVxWpM/s1600/11.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCw9oFIY6i6tOnKnNmeVe29sarJ2_l72UNtqKxtukq2ZIN3wzab4ro0tHzBLlNpA-sHHPzVveEhXq6BIq8L5tK14-_pecDdH86y1RcI9VtIlETdsYxtK-0Wy-IX2COiGU5B8vnXd0OLVY-/s1600/22.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCw9oFIY6i6tOnKnNmeVe29sarJ2_l72UNtqKxtukq2ZIN3wzab4ro0tHzBLlNpA-sHHPzVveEhXq6BIq8L5tK14-_pecDdH86y1RcI9VtIlETdsYxtK-0Wy-IX2COiGU5B8vnXd0OLVY-/s1600/22.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
就使用工具箱的Calendar 控制項&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:TextBox ID=&quot;txtDate&quot; runat=&quot;server&quot; Width=&quot;88px&quot; /&amp;gt;&lt;br /&gt;
做日期的點選後&lt;br /&gt;
再隱藏就好&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;asp:Calendar ID=&quot;Calendar1&quot; runat=&quot;server&quot;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BackColor=&quot;#FFFFCC&quot; BorderColor=&quot;#FFCC66&quot; BorderWidth=&quot;1px&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DayNameFormat=&quot;Shortest&quot; Font-Names=&quot;Verdana&quot; Font-Size=&quot;8pt&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ForeColor=&quot;#663399&quot; Height=&quot;200px&quot; ShowGridLines=&quot;True&quot; Width=&quot;220px&quot; &amp;nbsp;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;DayHeaderStyle BackColor=&quot;#FFCC66&quot; Font-Bold=&quot;True&quot; Height=&quot;1px&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;NextPrevStyle Font-Size=&quot;9pt&quot; ForeColor=&quot;#FFFFCC&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;OtherMonthDayStyle ForeColor=&quot;#CC9966&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;SelectedDayStyle BackColor=&quot;#CCCCFF&quot; Font-Bold=&quot;True&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;SelectorStyle BackColor=&quot;#FFCC66&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;TitleStyle BackColor=&quot;#990000&quot; Font-Bold=&quot;True&quot; Font-Size=&quot;9pt&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ForeColor=&quot;#FFFFCC&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;TodayDayStyle BackColor=&quot;#FFCC66&quot; ForeColor=&quot;White&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;/asp:Calendar&amp;gt;&lt;br /&gt;
&lt;br /&gt;
code behind&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not IsPostBack Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim myScript As String = Nothing&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myScript += &quot;&amp;lt;script type=&#39;text/javascript&#39;&amp;gt;&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myScript += &quot; &amp;nbsp; &amp;nbsp;function iniDisplay(tmpObj,tmpVal) {&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myScript += &quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var objID = document.getElementById(tmpObj);&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myScript += &quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objID.style.display = tmpVal;}&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myScript += &quot;&amp;lt;/script&amp;gt;&quot;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;不能使用 Add 須使用 RegisterStartupScript&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;Page.Controls.Add(New LiteralControl(myScript))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Page.ClientScript.RegisterStartupScript(Me.GetType(), &quot;onload&quot;, myScript)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If (Not Page.ClientScript.IsStartupScriptRegistered(&quot;alert&quot;)) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Page.ClientScript.RegisterStartupScript(Me.GetType(), &quot;alert&quot;, &quot;iniDisplay(&#39;CalendarDisp&#39;,&#39;none&#39;);&quot;, True)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txtDate.Attributes.Add(&quot;onclick&quot;, &quot;iniDisplay(&#39;CalendarDisp&#39;,&#39;&#39;);&quot;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs) Handles Calendar1.SelectionChanged&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txtDate.Text = Format(Calendar1.SelectedDate, &quot;yyyyMMdd&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If (Not Page.ClientScript.IsStartupScriptRegistered(&quot;alert&quot;)) Then&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Page.ClientScript.RegisterStartupScript(Me.GetType(), &quot;alert&quot;, &quot;iniDisplay(&#39;CalendarDisp&#39;,&#39;none&#39;);&quot;, True)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br /&gt;
&amp;nbsp; &amp;nbsp; End Sub&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN2jVagFSSAb0_n8Tc4fYCwglbVdj1ychC9npqU2vTuWcmaSF-F00qr8wzh-kguNo-ssJjkODvlDeaeaNYnqMBHOQVanRlmvvqAbo35Y-QL3m_ms24fq7wh4NrAvNVA7-YmI4uvFXhU07q/s1600/33.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN2jVagFSSAb0_n8Tc4fYCwglbVdj1ychC9npqU2vTuWcmaSF-F00qr8wzh-kguNo-ssJjkODvlDeaeaNYnqMBHOQVanRlmvvqAbo35Y-QL3m_ms24fq7wh4NrAvNVA7-YmI4uvFXhU07q/s1600/33.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
在點選日期時&lt;br /&gt;
結果發生了這個錯誤&lt;br /&gt;
想說一開始&lt;br /&gt;
即然就能隱藏跟彈出&lt;br /&gt;
沒有道理點選後再隱藏，就失效了......@#$%&lt;br /&gt;
將&amp;nbsp;myScript 的 iniDisplay 移出 aspx 再測試一下&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4cB-RDxMUlLVBFXt5k-ZgkH-WxY6t2PktsoaA8moMPHwI-UpOBl2KtTFu0Rco1rUvJY8w1Lu2sf5mB_7n_c5Or2HVs4mI_GCLORopxuGsgxHPHl2Cd0PWzf77kZw-wUCGp3WhyncnFCTJ/s1600/44.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4cB-RDxMUlLVBFXt5k-ZgkH-WxY6t2PktsoaA8moMPHwI-UpOBl2KtTFu0Rco1rUvJY8w1Lu2sf5mB_7n_c5Or2HVs4mI_GCLORopxuGsgxHPHl2Cd0PWzf77kZw-wUCGp3WhyncnFCTJ/s1600/44.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
嘿嘿嘿...收工，但真是搞不懂&lt;br /&gt;
&lt;br /&gt;&lt;a href=&quot;https://docs.google.com/file/d/0B7u0emnLMdUfc3o1R20zcmZHYTA/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;程式下載&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;書像降落傘一樣，要打開才有用；
程式......像咖啡一樣，要分享才能永續的存在。
I think therefore i am.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbtojava.blogspot.com/feeds/8205662883235768312/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://vbtojava.blogspot.com/2013/04/aspnet-calendar.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8205662883235768312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3668391560306792513/posts/default/8205662883235768312'/><link rel='alternate' type='text/html' href='http://vbtojava.blogspot.com/2013/04/aspnet-calendar.html' title='ASP.NET Calendar 隱藏的問題(必須要有物件)'/><author><name>Just a note</name><uri>http://www.blogger.com/profile/04132067863581696834</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/AVvXsEi5tzBuwTyWBo3E19PPmHp94Iy6c4L30nDEK10kuxL15G61pXLsu4ccPnxTUZh1VBlk7DpZPysY9QKw9HeJhkp7Jzi38z248TuxzJOpnkeVk5mc6MyFRZ2-SSkj2TPle2nU1bQ803EVxWpM/s72-c/11.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>