var username = Request[username]
var password = Request[password]
Chuoi = XL_USER.LuuTru(username,password)
public static USER [] Doc()
StreamReader reader = new StreamReader(@"C:\Test.txt");
int s = int.Parse(reader.ReadLine());
USER[] user = new USER[s];
for (int i = 0; i < user.Length; i++)
var m = reader.ReadLine().Split('/');
user[i].username = int.Parse(m[0]);
user[i].password = int.Parse(m[1]);
public static string Luu(USER[] user, string username, string password)
StreamWriter writer = new StreamWriter(@"C:\Test.txt");
writer.WriteLine($"{user.Length + 1}");
for (int i = 0; i < user.Length; i++)
writer.WriteLine($"{i+1},{user[i].username},{user[i].password}");
writer.WriteLine($"{user.Length + 1},{username},{password}");
public static string LuuTru(string username, string password)
USER [] user = LT_USER.Doc()
return LT_USER.Luu(user,username,password);
<form action="~/UI/MH_CONG_PHANSO.cshtml" method="post">
<label for="fname">Username:</label><br>
<input type="text" name="username" value=""><br>
<label for="lname">Password:</label><br>
<input type="text" name="password" value=""><br><br>
<input type="submit" value="Đăng ký">