两条VB语句转成C#
Dim myWebService As New com.efxnow.api.Service
Me.lblStatus.Text = myWebService.GetTime
转成C#语句怎么写?
com.efxnow.api.Service是web reference,Me是项目名称,
在C#里面是不用加Me的对吗?我加了也没有用,我写成:
com.efxnow.api.Service myWebService;
但是后面引用myWebService,老提示说myWebService没有定义,为什么?
------解决方案--------------------com.efxnow.api.Service myWebService = new ....应该会自己出来
vb的Me. 等于 c#的this.
------解决方案--------------------Dim myWebService As New com.efxnow.api.Service
Me.lblStatus.Text = myWebService.GetTime
------------------------------------------
com.efxnow.api.Service myWebService = New com.efxnow.api.Service();
this.lblStatus.Text = myWebService.GetTime().ToString();
------解决方案--------------------Dim myWebService As New com.efxnow.api.Service
Me.lblStatus.Text = myWebService.GetTime
------------------------------------------
com.efxnow.api.Service myWebService = new com.efxnow.api.Service();
this.lblStatus.Text = myWebService.GetTime();
------解决方案--------------------注意大小写~
------解决方案--------------------C#的关键字基本都是小写的