VB 暫停3秒 讀寫INI檔案

2021-04-20 16:56:59 字數 706 閱讀 5891

public declare sub sleep lib "kernel32" (byval dwmilliseconds as long)

'sleep 1000     '暫停1秒

'dim nowtime as date

'nowtime = now()

'while (datediff("s", nowtime, now()) < 3)

'doevents

'wend

'''msgbox "暫停3秒了已經"

'例如'private sub form_load()

'formsetting.textusername = getini("logconfig", "u", , "c:/a.ini")

''formsetting.textpassword = getini("logconfig", "p", , "c:/a.ini")''

'end sub

'private sub form_queryunload(cancel as integer, unloadmode as integer)

'writeini "logconfig", "u", formsetting.textusername, "c:/a.ini"

'writeini "logconfig", "p", formsetting.textpassword, "c:/a.ini"

'end sub

INI檔案讀寫

一 有必要了解ini檔案的結構 注釋 小節名 關鍵字 值 ini檔案允許有多個小節,每個小節又允許有多個關鍵字,後面是該關鍵字的值。值的型別有三種 字串 整型數值和布林值。其中字串存貯在ini檔案中時沒有引號,布林真值用1表示,布林假值用0表示。注釋以分號 開頭。二 定義 1 在inte ce的us...

讀寫ini檔案

using system using system.io using system.text using system.configuration using system.runtime.interopservices using system.collections.specialized us...

讀寫ini檔案

using system using system.io using system.text using system.configuration using system.runtime.interopservices using system.collections.specialized us...