![]() |
文字檔快速讀入TextBox (VB)
txtContent.Text = "" '清除內容
Open sFile$ For Input As #1 '開啟文字檔 txtContent.Text = StrConv(InputB(LOF(F), #1), vbUnicode) '一次讀入整個檔案 Close #1 '關閉檔案 出自: http://yes.nctu.edu.tw/VB/A1_Tips/Fi...tBox/Index.htm ========================= 其實捨去 Unicode 轉換很簡單可知原理 就是 Input(number, [#]filenumber) Input 函數的語法具有以下幾個單元: 單元 說明 number 必要的引數。任何正確的數值運算式,用來指出欲傳回的字元個數。 filenumber 必要的引數。任何正確的檔案代碼。 配合用 LOF 來得到檔案的長度 附註: InputB 函數是用來讀取文字檔中的位元組資料。不過在 InputB 函數中的引數 number 不是用來指出欲傳回的字元個數,而是用來指出欲傳回的位元組個數。 |
所有時間均為台北時間。現在的時間是 09:27 PM。 |
Powered by vBulletin® 版本 3.6.8
版權所有 ©2000 - 2025, Jelsoft Enterprises Ltd.
『服務條款』
* 有問題不知道該怎麼解決嗎?請聯絡本站的系統管理員 *