小编Att*_*lan的帖子

TextBox.Clear()或TextBox.Text = string.Empty

它们之间有什么区别吗?谢谢

TextBox.Clear();  
TextBox.Text = string.Empty;
Run Code Online (Sandbox Code Playgroud)

c# wpf

1
推荐指数
1
解决办法
1674
查看次数

ASP.NET Web APi - 将对象作为参数传递

用户控制器中的MakeUser方法用于创建用户名和密码.

[HttpGet]
public string MakeUser(UserParameters p)
{
    const string chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    string pass = "";
    Random r = new Random();
    for (int i = 0; i < p.Number; i++)
    {
        pass += chars[r.Next(0, 62)];
    }

    string firstTwoo = p.Name.Substring(0, 2);
    string firstThree = p.Surname.Substring(0, 3);

    return "Your username is: " + firstTwoo + firstThree + "\nYour password is: " + pass;
}
Run Code Online (Sandbox Code Playgroud)

UserParameter类,用于将参数作为对象发送.

public class UserParameters
{
    public int Number { get; set; }
    public string Name { get; …
Run Code Online (Sandbox Code Playgroud)

c# asp.net asp.net-web-api

0
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×2

asp.net ×1

asp.net-web-api ×1

wpf ×1