Private 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
Private 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 Private Sub Command1_Click()
A = WritePrivateProfileString("Shutdown", "CmdLine", Text1.Text, App.Path & "\scripts.ini")
End Sub
Private Sub Command2_Click()
Text1.Text = GetPrivateProfileInt("Shutdown", "CmdLine", -1, App.Path & "\scripts.ini")
If Text1.Text = -1 Then Exit Sub
End Sub按Command1保存配置 按Command2读取配置。。。
保存纯数字能正常读取,但是如果有字母或者符号就不行了,有没办法解决?
求教VB API GetPrivateProfileInt的问题。。
å¯ä»¥å
ä¹°ç®åç¹ç书ï¼ææ代ç ç¶åççå个åºæ¬åè½çç¨æ³å¤æ代ç ï¼å¼å§ä¸æ没å
³ç³»ï¼å¤ç»ä¹ çå®åï¼ä½ å¯ä»¥ç¨ä½ å¦çå个åè½ï¼åå¼ä¸ªèªå·±çä¸è¥¿è¿æ ·ä½ å°±å
¥é¨ç¶åä½ æ³å¼åï¼æåä»ä¹ä¸è¥¿åºæ¬çä¼äºï¼æäºåè½è¦å®ç°ä¸æç½çï¼å¯ä»¥ä¸ç½æ¥èµæï¼ä¸ç¹ä¸ç¹æç¥è¯é¢è¡¥å
¨ä¸å¼å§ä»ä¹é½ä¸æ没å
³ç³»ï¼è¿æ¯ä¸ä¸ªç§¯ç´¯çè¿ç¨æ们é½æ¯è¿æ ·å¦ä¹ çï¼ä¸ç¥éå¯¹ä½ ææ²¡å¸®å© QQ 704679529
温馨提示:答案为网友推荐,仅供参考