将 Quick BASIC 转换为 VB.Net - 随机访问文件
我正在尝试将旧的 Quick BASIC 程序转换为 VB.Net。旧文件语句似乎没有任何直接替代。对于我的简单需求来说,构建数据库似乎有点大材小用。
如何在 VB.Net 中执行以下操作?
OPEN "test.dat" FOR RANDOM AS #1 LEN = 20
FIELD #1, 10 AS a$, 10 AS b$
LSET a$ = "One"
LSET b$ = "Two"
PUT #1, 1
GET #1, 1
PRINT a$, b$
CLOSE #1
I'm trying to convert an old Quick BASIC program to VB.Net. There doesn't appear to be any direct replacement for the old file statements. Building a database seems like overkill for my simple needs.
How can I do the following in VB.Net?
OPEN "test.dat" FOR RANDOM AS #1 LEN = 20
FIELD #1, 10 AS a$, 10 AS b$
LSET a$ = "One"
LSET b$ = "Two"
PUT #1, 1
GET #1, 1
PRINT a$, b$
CLOSE #1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Microsoft.VisualBasic.FileOpen,FilePut 和 FileGet 语句应该可以直接替代您的大多数语句上面的代码。
The Microsoft.VisualBasic.FileOpen, FilePut, and FileGet statements should be pretty direct replacements for most of your code above.