VB6从TXT文件中提取此数据



我正在使用if语句读取 txt 文件中的字符串(如果存在(,然后执行我的代码,现在我试图找到更好的方法来执行此操作,而不是添加多个if语句来检测此特定字符串。

包含NOT FOUNDb.1j NOT FOUND (tried in 99lstwara repulse 99lstwara)的任何字符串。
我正在尝试确保程序检测到这一行,它可以工作,但有时它可能会错过它,我想要一个代码,它将 100% 检测到它总是没有找到的任何内容然后检测它。

[INFO] RetroArch 1.7.7 (Git 52dd39f98a)
[INFO] Redirecting save file to "C:Userspopppz.emulationstationsystemsretroarchsaves99lstwara.srm".
[INFO] Redirecting savestate to "C:Userspopppz.emulationstationsystemsretroarchstates99lstwara.state".
[INFO] === Build =======================================
[INFO] CPU Model Name: Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
[INFO] Capabilities: MMX MMXEXT SSE1 SSE2 SSE3 SSSE3 SSE4 SSE4.2 AVX AES 
[INFO] Built: May 10 2019
[INFO] Version: 1.7.7
[INFO] Git: 52dd39f98a
[INFO] =================================================
[INFO] Loading dynamic libretro core from: "C:UserspopppzAppDataRoamingRetroArchcoresmame2015_libretro.dll"
[INFO] [Overrides] no core-specific overrides found at C:Userspopppz.emulationstationsystemsretroarchconfigMAME 2015MAME 2015.cfg.
[INFO] [Overrides] no content-dir-specific overrides found at C:Userspopppz.emulationstationsystemsretroarchconfigMAME 2015rom test.cfg.
[INFO] [Overrides] no game-specific overrides found at C:Userspopppz.emulationstationsystemsretroarchconfigMAME 201599lstwara.cfg.
[INFO] [Shaders]: preset directory: C:Userspopppz.emulationstationsystemsretroarchshaderspresets
[INFO] Environ SET_VARIABLES.
[INFO] [Remaps]: remap directory: C:Userspopppz.emulationstationsystemsretroarchconfigremaps
[INFO] [Remaps]: no game-specific remap found at C:Userspopppz.emulationstationsystemsretroarchconfigremapsMAME 201599lstwara.rmp.
[INFO] [Remaps]: no content-dir-specific remap found at C:Userspopppz.emulationstationsystemsretroarchconfigremapsMAME 2015rom test.rmp.
[INFO] [Remaps]: no core-specific remap found at C:Userspopppz.emulationstationsystemsretroarchconfigremapsMAME 2015MAME 2015.rmp.
[INFO] Redirecting save file to "C:Userspopppz.emulationstationsystemsretroarchsaves99lstwara.srm".
[INFO] Redirecting savestate to "C:Userspopppz.emulationstationsystemsretroarchstates99lstwara.state".
[INFO] Environ GET_LOG_INTERFACE.
[INFO] Environ SYSTEM_DIRECTORY: "C:Userspopppz.emulationstationsystemsretroarchsystem".
[libretro INFO] SYSTEM_DIRECTORY: C:Userspopppz.emulationstationsystemsretroarchsystem[INFO] Environ CORE_ASSETS_DIRECTORY: "C:Userspopppz.emulationstationsystemsretroarchdownloads".
[libretro INFO] CONTENT_DIRECTORY: C:Userspopppz.emulationstationsystemsretroarchdownloads[libretro INFO] SAVE_DIRECTORY: C:Userspopppz.emulationstationsystemsretroarchsaves[INFO] Content loading skipped. Implementation will load it on its own.
[INFO] CRC32: 0x3841c5fe .
[INFO] Environ SET_PIXEL_FORMAT: RGB565.
[INFO] Skipping SRAM load..
[INFO] [RCHEEVOS]: Load task finished
[INFO] Version of libretro API: 1
[INFO] Compiled against API: 1
[libretro INFO] AV_INFO: width=320 height=240
[libretro INFO] AV_INFO: max_width=1600 max_height=1200
[libretro INFO] AV_INFO: aspect_ratio = 0.000000
[libretro INFO] AV_INFO: fps = 60.000000 sample_rate = 48000.000000
[INFO] [Audio]: Set audio input rate to: 47952.05 Hz.
[INFO] [Video]: Video @ 320x240
[INFO] [GL]: Found GL context: wgl
[INFO] [GL]: Detecting screen resolution 1920x1080.
[INFO] [WGL] extensions: WGL_EXT_depth_float WGL_ARB_buffer_region WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_pixel_format WGL_ARB_pbuffer WGL_EXT_extensions_string WGL_EXT_swap_control WGL_EXT_swap_control_tear WGL_ARB_multisample WGL_ARB_pixel_ÌŠÙ[INFO] [WGL]: Adaptive VSync supported.
[INFO] [WGL]: wglSwapInterval(1)
[INFO] [GL]: Vendor: Intel, Renderer: Intel(R) HD Graphics 4600.
[INFO] [GL]: Version: 4.3.0 - Build 10.18.14.4414.
[INFO] [GL]: Using resolution 320x240
[INFO] [GL]: Default shader backend found: glsl.
[INFO] [Shader driver]: Using GLSL shader backend.
[INFO] [GLSL]: Checking GLSL shader support ...
[WARN] [GL]: Stock GLSL shaders will be used.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] Setting up menu pipeline shaders for XMB ... 
[INFO] [GLSL]: Compiling ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling simple ribbon shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling modern snow shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling bokeh shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GLSL]: Compiling snowflake shader..
[INFO] [GLSL]: Found GLSL vertex shader.
[INFO] [GLSL]: Found GLSL fragment shader.
[INFO] [GLSL]: Linking GLSL program.
[INFO] [GL]: Using 4 textures.
[INFO] [GL]: Loaded 1 program(s).
[INFO] [GL]: Using GL_RGB565 for texture uploads.
[INFO] [XInput]: Found XInput v1.3.
[INFO] [DINPUT]: Enumerating joypads ...
[INFO] [DINPUT]: Done enumerating joypads ...
[INFO] [Joypad]: Found joypad driver: "dinput".
[INFO] [Font]: Using font rendering backend: freetype.
[INFO] [Video]: Found display server: win32
[INFO] [XAudio2]: Requesting 64 ms latency, using 64 ms latency.
[INFO] [Menu]: Found menu display driver: "gl".
[ERROR] Failed to create rendering backend: freetype.
Failed to open C:Userspopppz.emulationstationsystemsretroarchassetsozoneregular.ttf: No such file or directory
[ERROR] Failed to create rendering backend: stb.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] Failed to create rendering backend: freetype.
Failed to open C:Userspopppz.emulationstationsystemsretroarchassetsozonebold.ttf: No such file or directory
[ERROR] Failed to create rendering backend: stb.
[INFO] [Font]: Using font rendering backend: bitmap.
[INFO] [Menu]: Found menu display driver: "gl".
[ERROR] Failed to create rendering backend: freetype.
Failed to open C:Userspopppz.emulationstationsystemsretroarchassetsxmbmonochromefont.ttf: No such file or directory
[ERROR] Failed to create rendering backend: stb.
[INFO] [Font]: Using font rendering backend: bitmap.
[ERROR] Failed to create rendering backend: freetype.
Failed to open C:Userspopppz.emulationstationsystemsretroarchassetsxmbmonochromefont.ttf: No such file or directory
[ERROR] Failed to create rendering backend: stb.
[INFO] [Font]: Using font rendering backend: bitmap.
[WARN] [XMB] Asset missing: C:Userspopppz.emulationstationsystemsretroarchassetsxmbmonochromepngretroarch.png
[WARN] [XMB] Critical asset missing, no icons will be drawn
[INFO] [LED]: LED driver = 'null' 0000000000AB03C0
[INFO] [MIDI]: Initializing ...
[INFO] [MIDI]: Input disabled.
[INFO] [MIDI]: Output disabled.
[INFO] [MIDI]: Initialized "winmm" driver.
[INFO] Loading history file: [C:Userspopppz.emulationstationsystemsretroarchcontent_history.lpl].
[INFO] Loading history file: [C:Userspopppz.emulationstationsystemsretroarchcontent_favorites.lpl].
[INFO] Loading history file: [C:Userspopppz.emulationstationsystemsretroarchcontent_music_history.lpl].
[INFO] Loading history file: [C:Userspopppz.emulationstationsystemsretroarchcontent_video_history.lpl].
[INFO] Loading history file: [C:Userspopppz.emulationstationsystemsretroarchcontent_image_history.lpl].
[INFO] [GL]: VSync => on
[INFO] [WGL]: wglSwapInterval(1)
[INFO] Written to playlist file: C:Userspopppz.emulationstationsystemsretroarchcontent_history.lpl
[libretro INFO] Starting game:C:UserspopppzDesktoprom test99lstwara.zip
[libretro INFO] Game name: 99lstwara, Game description: '99: The Last War (set 2)
[libretro INFO] Creating frontend for game: 99lstwara
[libretro INFO] Softlists: 0
SOURCE FILE: src/mame/drivers/kyugo.c
PARENT: repulse
NAME: 99lstwara
DESCRIPTION: '99: The Last War (set 2)
YEAR: 1985
MANUFACTURER: Crux / Proma
[libretro INFO] Screen orientation: VERTICAL
Value  not supported for option netdevprovider - falling back to auto
[libretro INFO] OSD initialization complete
repulse.b4 NOT FOUND (tried in 99lstwara repulse 99lstwara)
b.1j NOT FOUND (tried in 99lstwara repulse 99lstwara)
g.1h NOT FOUND (tried in 99lstwara repulse 99lstwara)
r.1f NOT FOUND (tried in 99lstwara repulse 99lstwara)
m1.2c NOT FOUND (tried in 99lstwara repulse 99lstwara)
Required files are missing, the game cannot be run.

我有这个代码

Open App.path & "aretroarch.log" For Binary As #1
TextFileData = Space$(LOF(1))
Get #1, , TextFileData
Close #1
MyArray() = Split(TextFileData, "RetroArch")
'=======================================================
For i = 0 To UBound(MyArray())
If InStr(MyArray(i), "lexplode") > 0 And InStr(MyArray(i), "Sample") > 0 Then
ElseIf InStr(MyArray(i), "tried in") > 0 And InStr(MyArray(i), "NOT FOUND") > 0 Or InStr(MyArray(i), "NOT FOUND (tried") Or InStr(MyArray(i), "tried in") Or InStr(MyArray(i), "NOT FOUND") Or InStr(MyArray(i), "NOT FOUND") > 0 And InStr(MyArray(i), "tried in") > 0 Then

或此代码

ElseIf InStr(MyArray(i), "NOT FOUND") > 0 And InStr(MyArray(i), "tried in") > 0 Then

有没有更好的方法,因为我有几行if来检测任何具有NOT FOUND的字符串。

我看到你使用频道。也许文件系统对象可以帮助你

https://learn.microsoft.com/fr-fr/office/vba/language/reference/user-interface-help/filesystemobject-object

相关内容

  • 没有找到相关文章

最新更新