有人可以在这里帮忙.. 这是我的代码。
public partial class frmLogin : Form
{
EBServiceReference.EBServiceSoapClient Ebservice = new EBServiceReference.EBServiceSoapClient();
public frmLogin()
{
InitializeComponent();
colour.colordesign(this);
DataSet ds = new DataSet();
ds = Ebservice.GetBranch();
Common.PopulateCombo(cbBranchId, ds, "BranchName", "BranchID");
}
private void btnLogin_Click(object sender, EventArgs e)
{
try
{
//ClearAll();
errorProviderLogin.Clear();
if (ValidateControls() == 1)
{
int branchid = Convert.ToInt32(cbBranchId.SelectedValue);
string username = txtUserName.Text;
string password = txtPassword.Text;
int ret = Ebservice.Login(branchid, username, password);
if (ret == 0)
{
MessageBox.Show(Common.LoginMessage);
}
else
{
DataSet ds_user = null;
ds_user = Ebservice.GetUser(ret);
if (Convert.ToBoolean(ds_user.Tables[0].Rows[0][3]))
{//it is a temporary pwd
change_pwd chg = new change_pwd(ds_user);
chg.ShowDialog();
}
MDIEvolveBanking objMDIEvolveBanking = new MDIEvolveBanking();
this.Hide();
objMDIEvolveBanking.logedinuser = txtUserName.Text;
objMDIEvolveBanking.Show();
}
Common.LoginID = ret;
Common.BranchID = Convert.ToInt32(cbBranchId.SelectedValue);
//}
}
}
catch (Exception ex)
{
Common.WriteToErrorLog(ex.Message, ex.StackTrace, "Error in btnLogin_Click");
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void frmLogin_KeyDown(object sender, KeyEventArgs e)
{
if ((Keys)e.KeyValue == Keys.Escape)
{
this.Close();
}
}
private void txtUserName_TextChanged(System.Object sender, System.EventArgs e)
{
}
private void gbLogin_Enter(object sender, EventArgs e)
{
}
private void frmLogin_Load(System.Object sender, System.EventArgs e)
{
}
#region [Validate Controls]
public int ValidateControls()
{
int result=1;
if ((Validation.StringOnly(txtUserName.Text)==0))
{
errorProviderLogin.SetError(txtUserName, "Enter Name");
result = 0;
}
if (Validation.StringOnly(txtPassword.Text)==0)
{
errorProviderLogin.SetError(txtPassword, "Enter Password");
result = 0;
}
return result;
}
#endregion
}
这是我收到的错误。
在 ServiceModel 客户端配置部分中找不到引用合同“EBServiceReference.EBServiceSoap”的默认端点元素。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。