zoukankan
html css js c++ java
接口的使用
好长时间没用了.今年看 petshop 都有点快忘了.....
Account.cs
using
System;
using
System.Reflection;
using
System.Configuration;
namespace
Z_Petshop
{
/**/
///
<summary>
///
Account 的摘要说明。
///
</summary>
public
class
Account
{
public
int
SignIn(
string
userId,
string
password)
{
if
((userId.Trim()
==
string
.Empty)
||
(password.Trim()
==
string
.Empty))
return
10
;
IAccount dal
=
(IAccount)Assembly.Load(
"
Z_Petshop
"
).CreateInstance (
"
Z_Petshop.
"
+
"
Class_Account
"
);
int
account
=
dal.SignIn(userId, password);
return
account;
}
}
}
Class_Account.cs
using
System;
namespace
Z_Petshop
{
/**/
///
<summary>
///
Class_Account 的摘要说明。
///
</summary>
public
class
Class_Account : IAccount
{
public
int
SignIn(
string
userId,
string
password)
{
return
100
;
}
}
}
IAccount.cs
using
System;
namespace
Z_Petshop
{
/**/
///
<summary>
///
Iaccount 的摘要说明。
///
</summary>
public
interface
IAccount
{
int
SignIn(
string
userId,
string
password);
}
}
调用页面
private
void
Page_Load(
object
sender, System.EventArgs e)
{
//
在此处放置用户代码以初始化页面
Account s
=
new
Account ();
int
I
=
s.SignIn (
"
100
"
,
"
100
"
);
this
.Response .Write (I);
}
查看全文
相关阅读:
我来解数独(附delphi源码)
jquery(三)
jquery(二)
jquery(一)
前端之JS(五)
前端之JS(四)
前端之JS(三)
前端之JS(二)
前端之CSS(三)
前端之CSS(二)
原文地址:https://www.cnblogs.com/gwazy/p/154135.html
最新文章
C#获取字符首字母
生日转换成星座
多选打包下载
abstract class和interface的区别
EF5执行sql查询语句 Database.SqlQuery 带返回值;EF5中 执行 sql语句使用Database.ExecuteSqlCommand 返回影响的行数 ;
C#-在主线程中创建子线程
C# SQL不同时区的用户登录网站,根据后台提供的时间转换并显示成用户本地时间
JavaScript- onclick获取同行其它td的值
sql server中对xml进行操作
C#---- 单列模式(定时器)
热门文章
WPF——分页功能,动态添加过滤条件
R语言屌丝成长之路——学习路线
SQL server 获取另外一个服务器中的数据
近期小结
ICEcoder显示汉字出现乱码的处理
在phpnow中配置phpunit
Delphi7中使用Indy9的IdSmtp发送email时subject过长会出现乱码的解决办法
IE8提速经验
初用emmet
pspad的一个怪现象:在一些空行的位置出现个别不该出现的字符
Copyright © 2011-2022 走看看