如何在C#中创建二进制文件默认路径文件
how to create binary file default path file in C#
enter image description here 这个登录系统工作完美..但我需要更改默认路径..目前它保存在“C”驱动器上..可以保存在调试文件夹中。可能吗?
try
{
var sr = new System.IO.StreamReader("C:\" + textBox1.Text + "\login.ID");
username = sr.ReadLine();
password = sr.ReadLine();
sr.Close();
if (username == textBox1.Text && password == txtPass.Text)
{
MessageBox.Show("You are now successfully logged in |Welcome", "Success");
frmMainMenu frm = new frmMainMenu();
frm.Show();
this.Hide();
}
else
{
MessageBox.Show("User Name Or Password Wrong!", "Error");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
var currentDirectory = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
enter image description here 这个登录系统工作完美..但我需要更改默认路径..目前它保存在“C”驱动器上..可以保存在调试文件夹中。可能吗?
try
{
var sr = new System.IO.StreamReader("C:\" + textBox1.Text + "\login.ID");
username = sr.ReadLine();
password = sr.ReadLine();
sr.Close();
if (username == textBox1.Text && password == txtPass.Text)
{
MessageBox.Show("You are now successfully logged in |Welcome", "Success");
frmMainMenu frm = new frmMainMenu();
frm.Show();
this.Hide();
}
else
{
MessageBox.Show("User Name Or Password Wrong!", "Error");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
var currentDirectory = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);