我做了一个WinForm安装程序,在安装过程中需要用户输入数据库用户名与密码,但是我在程序中怎么来接受用户输入的用户名与密码呢?
安装包中:/dbname=[DBNAME] /server=[DBSERVERNAME] /user=[USERNAME] /pwd=[PASSWORD] /targetdir="[TARGETDIR]\"
程序中:
this.dbServerName = this.Context.Parameters["DBSERVERNAME"].ToString();
this.databaseName = this.Context.Parameters["DBNAME"].ToString();
this.userName = this.Context.Parameters["USERNAME"].ToString();
this.pwd = this.Context.Parameters["PASSWORD"].ToString();老是报“对象未引用,”结果我发现this.Context.Parameters["DBSERVERNAME"]为空, WEB程序中这样就行,但是在Winform中请大虾指教
安装包中:/dbname=[DBNAME] /server=[DBSERVERNAME] /user=[USERNAME] /pwd=[PASSWORD] /targetdir="[TARGETDIR]\"
程序中:
this.dbServerName = this.Context.Parameters["DBSERVERNAME"].ToString();
this.databaseName = this.Context.Parameters["DBNAME"].ToString();
this.userName = this.Context.Parameters["USERNAME"].ToString();
this.pwd = this.Context.Parameters["PASSWORD"].ToString();老是报“对象未引用,”结果我发现this.Context.Parameters["DBSERVERNAME"]为空, WEB程序中这样就行,但是在Winform中请大虾指教
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货