MF 的个人资料CMF.net照片日志列表更多 ![]() | 帮助 |
|
1月30日 加入參考 System.Design 組件 (.NET) 方案總管 -> 右鍵選單 -> 加入參考
命名空間: System.ComponentModel.Design System.ComponentModel.Design 命名空間 (Namespace) 包含的類別,可供開發人員用來建置 (Build) 元件的自訂設計階段行為以及在設計階段設定元件的使用者介面。設計階段環境提供讓開發人員排列元件和設定其屬性的系統。有些元件可能需要僅適用設計階段的行為,才能在設計階段環境中正常作用。提供協助開發人員設定元件或複雜資料型別值的自訂使用者介面可能也頗有價值。在此命名空間內定義的類別和介面,也可以用來建置元件的自訂設計階段行為、存取設計階段服務以及實作自訂的設計階段組態介面 說明文件 http://msdn2.microsoft.com/zh-tw/library/system.componentmodel.design(VS.80).aspx Visual Studio 2008 中文版 2008 年 2 月 1 日正式發表Visual Studio 2008 中文版 2008 年 2 月 1 日正式發表
1月25日 取得網路磁碟機及其路徑的對照 (C#)// Get UNC Path
[DllImport("mpr.dll")] [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode), Serializable()] 說明文件
|
|||||||||||||||||
| Converting network drive-based path to universal path name |
'The following code shows how to use the WNetGetUniversalName for converting 'network drive-based path (Like I:\windows) to universal path name (Like \\MyComputer\c\windows) ' Private Declare Function WNetGetUniversalName Lib "mpr" Alias "WNetGetUniversalNameA" _ (ByVal lpLocalPath As String, ByVal dwInfoLevel As Long, lpBuffer As Any, lpBufferSize As Long) As Long Private Const UNIVERSAL_NAME_INFO_LEVEL = 1 Private Const REMOTE_NAME_INFO_LEVEL = 2 Private Const UNIVERSAL_NAME_BUFFER_SIZE = 1000 Private Const NO_ERROR = 0 Private Type UNIVERSAL_NAME_INFO lpUniversalName As Long buf(UNIVERSAL_NAME_BUFFER_SIZE - 4) As Byte End Type Private Sub cmdGetUniversal_Click() Dim BufSize As Long Dim uni As UNIVERSAL_NAME_INFO BufSize = UNIVERSAL_NAME_BUFFER_SIZE If WNetGetUniversalName(txtPath.Text, UNIVERSAL_NAME_INFO_LEVEL, uni, BufSize) = NO_ERROR Then 'After we return from WNetGetUniversalName, the lpUniversalName contains a pointer for the 'universal path name. 'The pointer is usually points to the first byte of the buffer array '(buf variable in UNIVERSAL_NAME_INFO ). 'Just to be safe, I calculate the exact location of the string in the buffer, 'by the following expression: (The result is always 1) StartLoc = uni.lpUniversalName - VarPtr(uni) - 3 txtUniversal.Text = Mid$(StrConv(uni.buf, vbUnicode), StartLoc) Else MsgBox "Error: cannot find the universal path of " & txtPath.Text, vbOKOnly Or vbExclamation, "" End If End Sub |
|
|