1. 代码端

protected void Page_Load(object sender, EventArgs e)
{
#if Debug
        this.txtUserId.Text = "admin";
        this.txtPass.Attributes.Add("Value", "password");
#endif
}

可以实现在开发调试状态下登录名密码自动填写,发布时if Debug块的内容是不会被编译进发布包的

Step2 设置项目启用对应的条件编码

Vistual Studio 条件编辑应用Vistual Studio 条件编辑应用

相关文章:

  • 2021-04-02
  • 2022-03-05
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-02
  • 2021-07-11
  • 2021-07-24
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案