首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >vb6从txt文件中提取此数据

vb6从txt文件中提取此数据
EN

Stack Overflow用户
提问于 2019-12-29 12:21:06
回答 1查看 124关注 0票数 0

我使用if语句读取txt文件中的字符串--如果它存在,然后执行我的代码--现在我正在尝试找到一种更好的方法来实现这一点,而不是添加多个if语句来检测这个特定的字符串。

包含NOT FOUNDb.1j NOT FOUND (tried in 99lstwara repulse 99lstwara)的任何字符串。

我试图确保程序检测到这一行,它可以工作,但有时它可能会错过它,我想要一个代码,将百分之百地检测它,总是任何有没有找到的,然后检测它。

代码语言:javascript
复制
[INFO] RetroArch 1.7.7 (Git 52dd39f98a)
[INFO] Redirecting save file to "C:\Users\popppz\.emulationstation\systems\retroarch\saves\99lstwara.srm".
[INFO] Redirecting savestate to "C:\Users\popppz\.emulationstation\systems\retroarch\states\99lstwara.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:\Users\popppz\AppData\Roaming\RetroArch\cores\mame2015_libretro.dll"
[INFO] [Overrides] no core-specific overrides found at C:\Users\popppz\.emulationstation\systems\retroarch\config\MAME 2015\MAME 2015.cfg.
[INFO] [Overrides] no content-dir-specific overrides found at C:\Users\popppz\.emulationstation\systems\retroarch\config\MAME 2015\rom test.cfg.
[INFO] [Overrides] no game-specific overrides found at C:\Users\popppz\.emulationstation\systems\retroarch\config\MAME 2015\99lstwara.cfg.
[INFO] [Shaders]: preset directory: C:\Users\popppz\.emulationstation\systems\retroarch\shaders\presets
[INFO] Environ SET_VARIABLES.
[INFO] [Remaps]: remap directory: C:\Users\popppz\.emulationstation\systems\retroarch\config\remaps
[INFO] [Remaps]: no game-specific remap found at C:\Users\popppz\.emulationstation\systems\retroarch\config\remaps\MAME 2015\99lstwara.rmp.
[INFO] [Remaps]: no content-dir-specific remap found at C:\Users\popppz\.emulationstation\systems\retroarch\config\remaps\MAME 2015\rom test.rmp.
[INFO] [Remaps]: no core-specific remap found at C:\Users\popppz\.emulationstation\systems\retroarch\config\remaps\MAME 2015\MAME 2015.rmp.
[INFO] Redirecting save file to "C:\Users\popppz\.emulationstation\systems\retroarch\saves\99lstwara.srm".
[INFO] Redirecting savestate to "C:\Users\popppz\.emulationstation\systems\retroarch\states\99lstwara.state".
[INFO] Environ GET_LOG_INTERFACE.
[INFO] Environ SYSTEM_DIRECTORY: "C:\Users\popppz\.emulationstation\systems\retroarch\system".
[libretro INFO] SYSTEM_DIRECTORY: C:\Users\popppz\.emulationstation\systems\retroarch\system[INFO] Environ CORE_ASSETS_DIRECTORY: "C:\Users\popppz\.emulationstation\systems\retroarch\downloads".
[libretro INFO] CONTENT_DIRECTORY: C:\Users\popppz\.emulationstation\systems\retroarch\downloads[libretro INFO] SAVE_DIRECTORY: C:\Users\popppz\.emulationstation\systems\retroarch\saves[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:\Users\popppz\.emulationstation\systems\retroarch\assets\ozone\regular.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:\Users\popppz\.emulationstation\systems\retroarch\assets\ozone\bold.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:\Users\popppz\.emulationstation\systems\retroarch\assets\xmb\monochrome\font.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:\Users\popppz\.emulationstation\systems\retroarch\assets\xmb\monochrome\font.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:\Users\popppz\.emulationstation\systems\retroarch\assets\xmb\monochrome\png\retroarch.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:\Users\popppz\.emulationstation\systems\retroarch\content_history.lpl].
[INFO] Loading history file: [C:\Users\popppz\.emulationstation\systems\retroarch\content_favorites.lpl].
[INFO] Loading history file: [C:\Users\popppz\.emulationstation\systems\retroarch\content_music_history.lpl].
[INFO] Loading history file: [C:\Users\popppz\.emulationstation\systems\retroarch\content_video_history.lpl].
[INFO] Loading history file: [C:\Users\popppz\.emulationstation\systems\retroarch\content_image_history.lpl].
[INFO] [GL]: VSync => on
[INFO] [WGL]: wglSwapInterval(1)
[INFO] Written to playlist file: C:\Users\popppz\.emulationstation\systems\retroarch\content_history.lpl
[libretro INFO] Starting game:C:\Users\popppz\Desktop\rom test\99lstwara.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.

我有这个密码

代码语言:javascript
复制
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

或者这段代码

代码语言:javascript
复制
    ElseIf InStr(MyArray(i), "NOT FOUND") > 0 And InStr(MyArray(i), "tried in") > 0 Then

是否有更好的方法来执行此操作,因为我只有很少行的if来检测任何具有NOT FOUND的字符串。

EN

回答 1

Stack Overflow用户

发布于 2020-02-12 13:07:45

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59519358

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档