我的程序如何从打开的文件中获取信息 [英] how can my program get info from the file it opens

查看:68
本文介绍了我的程序如何从打开的文件中获取信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我已经制作了打开.abc文件的程序.我的程序需要打开每个文件的一些信息才能正常工作.我该怎么做,以便我的程序从打开的文件中获取信息.请帮助!

Hello,
I have made my program to open .abc files.My program needs some info from every file it opens to work. How do i do that so my program get info from the file it opens.Please Help!

推荐答案

您首先需要导入io流,然后再声明模块
you first need to import io streams this goes before you declare your module
imports system.io


然后,您可以使用io streamreader读取abc文件.


You then use an io streamreader to read the abc files.

Dim reader As New StreamReader("url")
Dim str As String
str = reader.ReadToEnd()
reader.Close()
reader = New StreamReader("url")
str = reader.ReadToEnd()
reader.Close()


将网址替换为C:\ users \ 1.abc
希望这就是您想要的.
詹姆斯


Replace url with something like C:\users\1.abc
Hope this is what you were looking for.
James


这篇关于我的程序如何从打开的文件中获取信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆