<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Good ITea :: MS Tech Share &#187; asp.net</title>
	<atom:link href="http://blog.lansea-chu.com/index.php/archives/tag/aspnet/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.lansea-chu.com</link>
	<description>Good Idea from Good ITea</description>
	<lastBuildDate>Tue, 27 Jul 2010 21:51:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[.NET]Silverlight 與 ASP.NET 互相傳值的溝通方式</title>
		<link>http://blog.lansea-chu.com/index.php/archives/640</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/640#comments</comments>
		<pubDate>Fri, 28 May 2010 14:23:04 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[silverlgiht]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=640</guid>
		<description><![CDATA[因為北商的學妹問我這個問題，
所以我做了個簡單的範例
這個範例採用了 QueryString 的方式來交互傳值，
這是最簡單的asp.net 與 silverlight 溝通方式，
當然，這是在 值 不重要，給使用者看到沒關係且可自由更改的情況之下才能用此方式
若值攸關隱密性，則必須使用Session傳值，若要使用Session傳值，
則必須使用WCF的方式來處理，然後在WCF驗證 值 的真偽
這樣才能安全處理值的交換，
(這是因為Silverlight是run在Client,而Session是儲存在Server端的關係)
這個範例可以在下面這個連結進行下載，
本範例使用VS2010 + Silverlight 製成。

若以上檔案連結無法看到 請點擊我進行檔案下載 
]]></description>
			<content:encoded><![CDATA[<p>因為北商的學妹問我這個問題，</p>
<p>所以我做了個簡單的範例</p>
<p>這個範例採用了 QueryString 的方式來交互傳值，</p>
<p>這是最簡單的asp.net 與 silverlight 溝通方式，</p>
<p>當然，這是在 值 不重要，給使用者看到沒關係且可自由更改的情況之下才能用此方式</p>
<p>若值攸關隱密性，則必須使用Session傳值，若要使用Session傳值，</p>
<p>則必須使用WCF的方式來處理，然後在WCF驗證 值 的真偽<br />
這樣才能安全處理值的交換，<br />
(這是因為Silverlight是run在Client,而Session是儲存在Server端的關係)</p>
<p>這個範例可以在下面這個連結進行下載，</p>
<p>本範例使用VS2010 + Silverlight 製成。</p>
<p><iframe title ="Preview" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:98px;height:115px;padding:0;background-color:#fcfcfc;" src="http://cid-5a40dd78df47f561.skydrive.live.com/embedicon.aspx/%e9%83%a8%e8%90%bd%e6%a0%bc%e5%88%86%e4%ba%ab%e6%aa%94%e6%a1%88/sample.rar"></iframe></p>
<p>若以上檔案連結無法看到 <a href="http://cid-5a40dd78df47f561.skydrive.live.com/self.aspx/%e9%83%a8%e8%90%bd%e6%a0%bc%e5%88%86%e4%ba%ab%e6%aa%94%e6%a1%88/sample.rar">請點擊我進行檔案下載</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/640/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[.NET]強制移除VS2008與所有2008版本的相關項目</title>
		<link>http://blog.lansea-chu.com/index.php/archives/637</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/637#comments</comments>
		<pubDate>Tue, 25 May 2010 06:53:40 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=637</guid>
		<description><![CDATA[這幾天要移除掉VS2008改安裝為VS2010
發現VS2008移除不掉
一直產生 載入安裝元件發生錯誤 無法移除 的錯誤,
上網找到了微軟有提供這個移除用的程式
除了可以強制移除VS2008外，還可以順便移除掉VS2008殘留下來沒用的程式
不用一個一個手動移除了
程式可以在這兒下載　http://go.microsoft.com/fwlink/?LinkId=105801
]]></description>
			<content:encoded><![CDATA[<p>這幾天要移除掉VS2008改安裝為VS2010</p>
<p>發現VS2008移除不掉</p>
<p>一直產生 <strong>載入安裝元件發生錯誤 無法移除</strong> 的錯誤,</p>
<p>上網找到了微軟有提供這個移除用的程式</p>
<p>除了可以強制移除VS2008外，還可以順便移除掉VS2008殘留下來沒用的程式</p>
<p>不用一個一個手動移除了</p>
<p>程式可以在這兒下載　<a title="http://go.microsoft.com/fwlink/?LinkId=105801" href="http://go.microsoft.com/fwlink/?LinkId=105801">http://go.microsoft.com/fwlink/?LinkId=105801</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/637/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ASP.NET]Google Map API 取得經緯度</title>
		<link>http://blog.lansea-chu.com/index.php/archives/353</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/353#comments</comments>
		<pubDate>Tue, 19 May 2009 10:55:16 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=353</guid>
		<description><![CDATA[ 
分享一下程式碼
剛好用到這部份:-)    

這函數會回傳一個字串陣列
其中第二個元素就是經 第三個就是緯 丟到Googe MAP API後就可以運作了
 
  Function getxy() As String()       
         Dim address As String = 『你的地址』
        Dim apikey = 『你的API Key』
        Dim url = 『http://maps.google.com/maps/geo?q=』 &#38; address &#38; 『&#38;output=csv&#38;key=』 &#38; apikey
        Dim myrequest As System.Net.HttpWebRequest = System.Net.WebRequest.Create(url)
        Dim mywebresponse As System.Net.WebResponse = myrequest.GetResponse()
   [...]]]></description>
			<content:encoded><![CDATA[<p> </p>
<p>分享一下程式碼</p>
<p>剛好用到這部份:-)    </p>
<p><span id="more-353"></span></p>
<p>這函數會回傳一個<strong>字串陣列</strong></p>
<p>其中<strong>第二個元素就是經</strong> <strong>第三個就是緯</strong> 丟到Googe MAP API後就可以運作了</p>
<p> </p>
<p>  <span style="color: #0000ff;">Function getxy() As String()       </span></p>
<p>     <span style="color: #0000ff;"> </span><span style="color: #0000ff;">   Dim address As String = 『你的地址』</span></p>
<p><span style="color: #0000ff;">        Dim apikey = 『你的API Key』</span></p>
<p><span style="color: #0000ff;">        Dim url = 『http://maps.google.com/maps/geo?q=』 &amp; address &amp; 『&amp;output=csv&amp;key=』 &amp; apikey</span></p>
<p><span style="color: #0000ff;">        Dim myrequest As System.Net.HttpWebRequest = System.Net.WebRequest.Create(url)</span></p>
<p><span style="color: #0000ff;">        Dim mywebresponse As System.Net.WebResponse = myrequest.GetResponse()</span></p>
<p><span style="color: #0000ff;">        Dim mystream As IO.Stream = mywebresponse.GetResponseStream()</span></p>
<p><span style="color: #0000ff;">        Dim sr As IO.StreamReader = New IO.StreamReader(mystream, Encoding.Default)</span></p>
<p><span style="color: #0000ff;">        Return Split(sr.ReadToEnd, 『,』)</span></p>
<p><span style="color: #0000ff;">  End Function</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/353/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[ASP.NET]上傳圖片後進行等比例縮圖(Zoom)</title>
		<link>http://blog.lansea-chu.com/index.php/archives/330</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/330#comments</comments>
		<pubDate>Wed, 06 May 2009 11:51:57 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=330</guid>
		<description><![CDATA[一樣,最近作專案有用到
用途是於上傳圖片的同時進行縮圖處理
如此日後可以減少圖片下載時所需的頻寬(因為圖檔被縮小了)
也可以強制圖片必須為長寬多少內~(若使用者本身不懂縮圖,這個函數會自動幫忙處理)
 
分享一下原始碼跟方法

&#8216;原始碼開始
 
  &#8217;縮圖


    Sub imgresize(ByVal width As Integer, ByVal height As Integer, ByVal saveurl As String, ByVal filebytes As Byte(), ByVal filelength As Integer)


        Dim ms As MemoryStream = New MemoryStream
        ms.Write(filebytes, 0, filelength)
        ms.Flush()
        Dim img1 As System.Drawing.Image = System.Drawing.Image.FromStream(ms)
        If img1.Height &#62; height Or img1.Width [...]]]></description>
			<content:encoded><![CDATA[<p>一樣,最近作專案有用到</p>
<p>用途是於上傳圖片的同時進行縮圖處理</p>
<p>如此日後可以減少圖片下載時所需的頻寬(因為圖檔被縮小了)</p>
<p>也可以強制圖片必須為長寬多少內~(若使用者本身不懂縮圖,這個函數會自動幫忙處理)</p>
<p> </p>
<p>分享一下原始碼跟方法</p>
<p><span id="more-330"></span></p>
<p>&#8216;原始碼開始</p>
<p> </p>
<p><span style="color: #339966;"> </span><span style="color: #339966;"><strong> &#8217;縮圖</strong></span></p>
<p><strong><br />
</strong></p>
<p><strong>    Sub imgresize(ByVal width As Integer, ByVal height As Integer, ByVal saveurl As String, ByVal filebytes As Byte(), ByVal filelength As Integer)</strong></p>
<p><strong><br />
</strong></p>
<p><strong>        Dim ms As MemoryStream = New MemoryStream</strong></p>
<p><strong>        ms.Write(filebytes, 0, filelength)</strong></p>
<p><strong>        ms.Flush()</strong></p>
<p><strong>        Dim img1 As System.Drawing.Image = System.Drawing.Image.FromStream(ms)</strong></p>
<p><strong>        If img1.Height &gt; height Or img1.Width &gt; width Then</strong></p>
<p><strong>   </strong><span style="color: #339966;"><strong>         &#8217;是否有超高or寬</strong></span></p>
<p><strong>            Dim newimg As System.Drawing.Image</strong></p>
<p><strong>            Dim thumbnailScale As Integer() = getThumbnailImageScale(width, height, img1.Width, img1.Height)</strong></p>
<p><strong>      </strong><span style="color: #339966;"><strong>      &#8217;算出原圖長寬比</strong></span></p>
<p><strong>            newimg = img1.GetThumbnailImage(thumbnailScale(0), thumbnailScale(1), Nothing, IntPtr.Zero)</strong></p>
<p><strong>       </strong><span style="color: #339966;"><strong>     &#8217;釋放資源</strong></span></p>
<p><strong>            newimg.Save(saveurl)</strong></p>
<p><strong>            newimg.Dispose()</strong></p>
<p><strong>            img1.Dispose()</strong></p>
<p><strong>            ms.Close()</strong></p>
<p><strong>        End If</strong></p>
<p><strong><br />
</strong></p>
<p><strong>    End Sub</strong></p>
<p><strong><br />
</strong></p>
<p><strong>    Function getThumbnailImageScale(ByVal maxWidth As Integer, ByVal maxHeight As Integer, ByVal oldWidth As Integer, ByVal oldHeight As Integer) As Integer()</strong></p>
<p><strong>        Dim result() As Integer = New Integer() {0, 0}</strong></p>
<p><strong>        Dim widthDividend As Single, heightDividend As Single, commonDividend As Single</strong></p>
<p><strong>        widthDividend = oldWidth / maxWidth</strong></p>
<p><strong>        heightDividend = oldHeight / maxHeight</strong></p>
<p><strong>        If (heightDividend &gt; widthDividend) Then</strong></p>
<p><strong>            commonDividend = heightDividend</strong></p>
<p><strong>        Else</strong></p>
<p><strong>            commonDividend = widthDividend</strong></p>
<p><strong>        End If</strong></p>
<p><strong>        result(0) = CType((oldWidth / commonDividend), Integer)</strong></p>
<p><strong>        result(1) = CType((oldHeight / commonDividend), Integer)</strong></p>
<p><strong>        Return result</strong></p>
<p><strong>    End Function</strong></p>
<p> </p>
<p>&#8216;原始碼結束</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/330/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>[ASP.NET]Crystal Report 上傳到其它主機後無法執行</title>
		<link>http://blog.lansea-chu.com/index.php/archives/206</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/206#comments</comments>
		<pubDate>Fri, 23 Jan 2009 09:31:57 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[crystal]]></category>
		<category><![CDATA[report]]></category>
		<category><![CDATA[主機]]></category>
		<category><![CDATA[無法]]></category>
		<category><![CDATA[載入]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=206</guid>
		<description><![CDATA[這是因為該主機上沒有裝Crystal Report.NET的可轉散發套件，
就是俗稱的runtime啦:)

那麼，該怎麼裝呢。
首先您必須在該設計的電腦上找到
C:\Program Files\Microsoft Visual Studio 9.0\Crystal Reports\
(以VS2008為例，若為2005，則為8.0)
這個資料夾，接著會看到CRRedist目錄，
裡面就會有您的設計機的處理器類型的可轉散發套件了
若要執行的主機是64位元的，則要想辦法從64位元的VS中拿出這個套件唷。
在這裡本人提供64位元的2008版本下載。
PS. Crystal Report.NET與 CrystalReport 的授權方式有些不同。
在這僅是讀取元件的部分，因此這個可轉散發套件
就如同Flash Player，是可以轉散發的！
請點擊以下下載點從Skydrive取得檔案

]]></description>
			<content:encoded><![CDATA[<p>這是因為該主機上沒有裝Crystal Report.NET的可轉散發套件，</p>
<p>就是俗稱的runtime啦:)<br />
<span id="more-206"></span></p>
<p>那麼，該怎麼裝呢。</p>
<p>首先您必須在該設計的電腦上找到<br />
<strong>C:\Program Files\Microsoft Visual Studio 9.0\Crystal Reports\</strong><br />
(以VS2008為例，若為2005，則為8.0)<br />
這個資料夾，接著會看到CRRedist目錄，<br />
裡面就會有您的設計機的處理器類型的可轉散發套件了</p>
<p>若要執行的主機是64位元的，則要想辦法從64位元的VS中拿出這個套件唷。</p>
<p>在這裡本人提供64位元的2008版本下載。<br />
PS. Crystal Report.NET與 CrystalReport 的授權方式有些不同。<br />
在這僅是讀取元件的部分，因此這個可轉散發套件<br />
就如同Flash Player，是可以轉散發的！</p>
<p>請點擊以下下載點從Skydrive取得檔案</p>
<p><iframe scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="width:240px;height:66px;margin:3px;padding:0;border:1px solid #dde5e9;background-color:#ffffff;" src="http://cid-5a40dd78df47f561.skydrive.live.com/embedrowdetail.aspx/%e9%83%a8%e8%90%bd%e6%a0%bc%e5%88%86%e4%ba%ab%e6%aa%94%e6%a1%88/IA64.zip"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/206/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[ASP.NET]線上解壓縮的寫法</title>
		<link>http://blog.lansea-chu.com/index.php/archives/58</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/58#comments</comments>
		<pubDate>Fri, 27 Jun 2008 19:55:56 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[.NET程式設計]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[zip]]></category>
		<category><![CDATA[解壓縮]]></category>

		<guid isPermaLink="false">http://blog.lansea-chu.com/?p=58</guid>
		<description><![CDATA[最近在寫一個系統有用到
就分享寫法出來吧

其實很容易的，只是透過zip的command mode
在用asp.net 去呼叫執行，並且帶入參數就可以
 
    Protected Sub exzip()
        Dim dir As String = 『C:\』 &#8216;主要目錄
        Dim zip As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo()
        zip.FileName = Server.MapPath(『zip.exe』)
        zip.Arguments = 』 x 』 &#38; dir &#38; 『\』 &#38; DropDownList1.SelectedValue &#38; 』 -o』 &#38; dir &#38; 』 -y』
        Dim ziprocess As Diagnostics.Process = System.Diagnostics.Process.Start(zip)
        Label2.Text = DropDownList1.SelectedValue &#38; 『解壓縮成功』
        ziprocess.WaitForExit(180000)
        If [...]]]></description>
			<content:encoded><![CDATA[<p>最近在寫一個系統有用到</p>
<p>就分享寫法出來吧</p>
<p><span id="more-58"></span></p>
<p>其實很容易的，只是透過zip的command mode</p>
<p>在用asp.net 去呼叫執行，並且帶入參數就可以</p>
<p> </p>
<p><span style="color: #0000ff;">    Protected Sub exzip()<br />
        Dim dir As String = 『C:\』 &#8216;主要目錄<br />
</span><span style="color: #0000ff;">        Dim zip As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo()<br />
        zip.FileName = Server.MapPath(『zip.exe』)<br />
        zip.Arguments = 』 x 』 &amp; dir &amp; 『\』 &amp; DropDownList1.SelectedValue &amp; 』 -o』 &amp; dir &amp; 』 -y』<br />
        Dim ziprocess As Diagnostics.Process = System.Diagnostics.Process.Start(zip)<br />
        Label2.Text = DropDownList1.SelectedValue &amp; 『解壓縮成功』<br />
        ziprocess.WaitForExit(180000)<br />
        If Not ziprocess.HasExited Then<br />
            Label2.Text = 『壓縮檔無法在3分鐘內解壓縮完畢，解壓縮失敗』<br />
            ziprocess.Kill()<br />
        End If<br />
    End Sub</span><br />
 </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/58/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[ASP.NET]簡易的讀取／寫入txt文字檔操作</title>
		<link>http://blog.lansea-chu.com/index.php/archives/52</link>
		<comments>http://blog.lansea-chu.com/index.php/archives/52#comments</comments>
		<pubDate>Tue, 24 Jun 2008 08:16:06 +0000</pubDate>
		<dc:creator>Lansea.Chu</dc:creator>
				<category><![CDATA[技術文章]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[txt]]></category>
		<category><![CDATA[write]]></category>

		<guid isPermaLink="false">http://lansea.wordpress.com/?p=78</guid>
		<description><![CDATA[有時候我們會用到記錄資料的功能
但也許資料非常的小巧且對安全性不要求
比方說，今日瀏覽人數之類的
（當然若這些資料需要做分析性報表則不適合存在文字檔中）
那如果這些資料存在資料庫會不會太大材小用？

因此我們一般是存在txt文字檔當中&#8230;
一來加快讀取的速度，一來要求的基本空間跟條件也較小
而在ASP.NET中，讀取跟寫入文字檔是非常容易的，快速的兩行即可解決
讀取：
FileOpen(1, Server.MapPath(『howmuch.txt』), OpenMode.Input)
test = LineInput(1)
寫入：
FileOpen(1, Server.MapPath(『howmuch.txt』), OpenMode.Output)
Print(1, value)
對於簡單的小巧資料，用這種方式既快速且方便～
]]></description>
			<content:encoded><![CDATA[<p>有時候我們會用到記錄資料的功能</p>
<p>但也許資料非常的小巧且對安全性不要求</p>
<p>比方說，今日瀏覽人數之類的</p>
<p>（當然若這些資料需要做分析性報表則不適合存在文字檔中）</p>
<p>那如果這些資料存在資料庫會不會太大材小用？</p>
<p><span id="more-52"></span></p>
<p>因此我們一般是存在txt文字檔當中&#8230;</p>
<p>一來加快讀取的速度，一來要求的基本空間跟條件也較小</p>
<p>而在ASP.NET中，讀取跟寫入文字檔是非常容易的，快速的兩行即可解決</p>
<p>讀取：</p>
<p><span style="color:#0000ff;">FileOpen(1, Server.MapPath(『howmuch.txt』), OpenMode.Input)<br />
test = LineInput(1)</span></p>
<p>寫入：</p>
<p><span style="color:#0000ff;">FileOpen(1, Server.MapPath(『howmuch.txt』), OpenMode.Output)<br />
Print(1, value)</span></p>
<p>對於簡單的小巧資料，用這種方式既快速且方便～</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lansea-chu.com/index.php/archives/52/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
