现在用c#东西 ,由于现在是在开发阶段,所以把登录的信息用下面的代码写上了:#define DEBUG
#define MYTEST
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;private void FrmLogin_Load(object sender, EventArgs e)
{
#if (DEBUG && !MYTEST) //在这里怎么写,才能在发布后不会显示上用户名和密码呢 ??
this.txtUserName.Text = "admin";
this.txtPsd.Text = "admin";
#endif
}
#define MYTEST
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;private void FrmLogin_Load(object sender, EventArgs e)
{
#if (DEBUG && !MYTEST) //在这里怎么写,才能在发布后不会显示上用户名和密码呢 ??
this.txtUserName.Text = "admin";
this.txtPsd.Text = "admin";
#endif
}
我在调成release 时 还能显示用户名和密码
是#define MYTEST吗??
不怎么明白这些命令
this.txtPsd.Text = "admin";
这样赋值了 前台肯定能看到了。
还是不懂提问者要达到什么目的
这两行代码有问题
#define DEBUG
#define MYTEST
DEBUG在调试模式下已经定义了。项目->属性->生成,定义DEBUG常量在DEBUG模式下是勾选的。