常用的My物件
1.取得目前網站或應用程式的實體路徑
My.Request.PhysicalApplicationPath
2.使用My.Computer.FileSystem讀取文字檔 , 讀取一個xml檔
My.Computer.FileSystem.ReadAllText(My.Request.PhysicalApplicationPath() &
"\ddmg\cate.xml", _
System.Text.Encoding.UTF8)
3.My.Computer.Network物件
IsAvailable
DownloadFile 從遠端位置下載檔案 (要注意儲存的位置是否具有權限)
My.Computer.Network.DownloadFile("
http://192.168.1.6/ddmg/cate.xml",
_
My.Request.PhysicalApplicationPath() & "\cate.txt")
Ping
UploadFile
4.My.Computer.Registry
Dim keyLists As System.Collections.IEnumerable = _
My.Computer.Registry.ClassesRoot.GetSubKeyNames
For Each keyName As String In keyLists
Me.TextBox1.Text &= keyName &
"-------"
Next
5.My.Request、My.Response 與 Request、Response相同的
6.My.Log
My.Log.WriteEntry("記錄的資訊")
在<Page 裡要打開 Trace = "true" .....
7.My.Resources資源檔物件
1.先建立一個Resource物件檔(放在App_GlobalResources) , 然後加入二個圖片HDD_Tune1跟 2