【发布时间】:2009-07-15 05:00:38
【问题描述】:
下面是我正在使用的代码 sn-p。
using System;
using System.Collections.Generic;
using System.Text;
namespace businessTMS
{
public class SignIn
{
public string authenticate(String UserName, String password)
{
dataTMS.SignIn data = new dataTMS.SignIn();
string authenticate=(string)data.authenticate(UserName, password);
return authenticate;
}
}
}
【问题讨论】:
-
这是一个很好的代码 sn-p 你有,但你的问题是什么,到目前为止你尝试了什么?
-
您的 dataTMS.SignIn 验证方法肯定会返回一个布尔值。您为什么要在 businessTMS 中返回字符串?如果是这样,您试图将什么字符串推回 UI? “登录”与“未登录”?为什么是字符串?而不仅仅是将它作为 boolean (public bool authenticate(...) ?
-
@Simucal:很好的重新标记,我也正要这样做!
-
虽然是编译器错误,不是异常。
标签: c# .net casting compiler-errors