在Visual Basic中保存信息 [英] Saving Information in Visual Basic

查看:88
本文介绍了在Visual Basic中保存信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想知道在程序运行时用户是否可以保存信息。因此,如果我提示用户输入他们的名字并输入,他们是否可以退出正在运行的程序,然后当他们启动程序时,
会自动显示他们的名字,这是我的简单代码 

So I wanted to know if it was possible for the User to Save information when the Program is running. So if I prompt the User to enter their name and they enter it, is it possible for them to exit the running program and then when they start the program it will automatically display their name, here is my simple code 

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Change As String
        Change = InputBox("What is Your Name?")
        lblChange.Text = Change
    End Sub
End Class

推荐答案

是。

你可以使用设置。

创建设置字符串

IE:FullName

IE: FullName

然后在代码中

My.Settings.FullName=InputBox("Whats you full name")
my.settings.save

抬头,你可能会在这里被私刑使用输入框 

Heads up, you may get lynched around here for using inputbox 


这篇关于在Visual Basic中保存信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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