C# Inputbox string value

99封情书 提交于 2021-02-08 12:01:23

问题


I'm creating a login that saves data on a database.

How do I declare the Name entered to the string value as name so when I say .Show it returns the name I typed in?

private void btnLogIn_Click(object sender, EventArgs e)
{
    string input = Microsoft.VisualBasic.Interaction.InputBox("Prompt", "Title",Name, 0, 0);
    MessageBox.Show(Name);
}

回答1:


Easy as this:

Change

MessageBox.Show(Name);

to

MessageBox.Show(input);


来源:https://stackoverflow.com/questions/30176994/c-sharp-inputbox-string-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!