Filed under: 程序开发 |
Posted on March 1st, 2006 by 李 方进
最近的一个项目需要用到这个技术,于是做了一个demo来验证可行性
webservice是用c#写的,提供三个操作:UserLevel 、UserDate、IsLogin
在delphi中使用webservice导入,以下为主程序:
- procedure TForm1.Btn_OkClick(Sender: TObject);
- var
- strWSDL:string;
- Iservice:Service1Soap;
- msg:widestring;
- strUsername:string;
- strPassword:string;
- IsLogin:boolean;
- UserLevel:integer;
- UserDate:string;
- begin
- strWSDL:= Edit1.Text;
- HTTPRIO1.WSDLLocation:=strWSDL;
- strUsername:=EdtUserName.Text;
- strPassword:=EdtPassword.Text;
- //HTTPRIO1.HTTPWebNode.Agent := 'Borland SOAP 1.2';
- //HTTPRIO1.HTTPWebNode.UseUTF8InHeader := true;
- Iservice:= HTTPRIO1 as Service1Soap;
- IsLogin:= Iservice.IsLogin(strUsername,strPassword);
- if IsLogin=true then
- begin
- UserLevel:= Iservice.UserLevel(strUsername,strPassword);
- UserDate:= Iservice.UserDate(strUsername,strPassword);
- msg:='登陆成功,到期时间为'+UserDate;
- if UserLevel=2 then
- begin
- msg:=msg+'付费用户';
- Edt_1.ReadOnly:=false;
- Edt_2.ReadOnly:=false;
- end
- else
- begin
- msg:=msg+'免费用户';
- Edt_1.ReadOnly:=true;
- Edt_2.ReadOnly:=false;
- end
- end
- else
- msg:='登陆失败,用户名或者密码错误';
- LblMsg.Caption:=msg;
- end;
相关文章
« 穷啊穷
April 9th, 2006 at 7:29 pm
不错,不错。。。
PING:
BLOG NAME: prozac
TITLE: buy prozac
Prozac and Depression Information from…
PING:
BLOG NAME: prozac
TITLE: buy prozac
Prozac and Depression Information from…
PING:
BLOG NAME: Hichkok Blog
TITLE: Hichkok
my favorits…
PING:
BLOG NAME: beatten chloe
TITLE: Reforms to Gun Dealer Sales Practices Reduce Supply of New Guns to Criminals
sex School of hotels Public misc Health’s Center for Gun Policy and Research. The study appears in the September/October …