2010/06/30

[Silverlight] 取得文件路徑/參數/檔案路徑

使用 HtmlPage 需匯入命名空間: System.Windows.Browser

取得網頁路徑: HtmlPage.Document.DocumentUri.ToString()

取得參數: HtmlPage.Document.QueryString["param"]



取得 Silverlight 應用程式路徑: Application.Current.Host.Source.AbsoluteUri.ToString()

2010/06/12

[iPhone] How To Make An iPhone App.


iPhone 4 is coming up soon. Would you like to develope some iPhone apps on your own? Below is a useful resource I found recently~ Hope this helps!

Learn how to develop an iPhone app that people will buy even if you never programmed before!

2010/05/15

[Silverlight 4] 列印功能

1. 引入 namespace
System.Windows.Printing

2. 建立 PrintDocument
3. 建立對應 Event
  • BeginPrint
  • EndPrint
  • PrintPage - e.PrintVisual (指定列印目標物件), 確認 e.HasMorePages (是否有多頁)
4. 最後指定 PrintDocument 物件 Print 的文件名稱
Print("MyDocument")

2010/05/06

[ASP.NET] 轉換 ArrayList 至字串陣列

VB:

Dim str() As String = arrList.ToArray(GetType(String))

C#:

string[] strings = (string[])arrList.ToArray(typeof(string));

2010/05/03

[.NET] Bitmap to byte array

byte[] bytes = (byte[])System.ComponentModel.TypeDescriptor.GetConverter(bmp).ConvertTo(bmp, typeof(byte[]));

參考網址: Bitmap to byte array

2010/04/27

[ASP.NET] Forms 登入驗證

命名空間
System.Web.Security

驗證
FormsAuthentication.RedirectFromLoginPage(username, true)

登出
FormsAuthentication.SignOut()

查證是否驗證
User.Identity.IsAuthenticated

ASP.NET MVC (在 Controller 的 Action 前加 Authorize 屬性)
[Authorize]
e.g.
[Authorize]
public ActionResult Index() { return View(); }



相關資料: