none
VB程式抓取S.INI(組態設定檔)的程式,到VB.NET會有錯誤!!WHY?? RRS feed

  • 問題

  •  

    請教各位大大

    下面為VB6抓取S.ini的程式:

     

    Public Const HWND_BROADCAST = &HFFFF&
        Public Const WM_WININICHANGE = &H1A

        Public Declare Function GetProfileString Lib "kernel32" Alias _
                "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As _
                String, ByVal lpDefault As String, ByVal lpReturnedString As String, _
                ByVal nSize As Long) As Long

        Public Declare Function WriteProfileString Lib "kernel32" Alias _
                "WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName _
                As String, ByVal lpszString As String) As Long

        Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
               (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
        ByVal lParam As Any) As Long

        '讀取 INI 中的數值資料             若無法讀取則傳回 Default 值  'INI 檔的名稱及路徑
        Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long

        '讀取 INI 中的字串資料             '若是傳入 vbNullString,則傳回所有的 Section 名稱  '若是傳入 vbNullString,則傳回所有的 Key 名稱    'Key 的內容Default 值          '無法讀取則傳回第三個參數 Default 值 '傳回值的長度
        Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

        Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long


     

    但是我到VB.NET時會出現錯誤,錯誤為declare陳述式中不支援 as any

     

    who can help me??

    2007年11月30日 上午 05:53

解答

所有回覆