如何赋值给类中类?

blueapple0750 2017-03-14 08:45:56
我也不知这样说法对不对,就是一个类中有个属性又是一个类,如何给这个属性赋值?

'
'此源代码是由 Microsoft.VSDesigner 2.0.50727.5485 版自动生成。
'
Namespace com.aisinogz.www

'''<remarks/>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483"), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="IEliWebServiceHttpBinding", [Namespace]:="http://webservice.companyInterface.dzfp.fp.aisinogd.com")> _

Partial Public Class ElectroniceInfo

Private bMB_BBHField As String
.
.
.
Public Property EMAIL() As String
Get
Return Me.eMAILField
End Get
Set
Me.eMAILField = value
End Set
End Property

'''<remarks/>

<System.Xml.Serialization.XmlArrayAttribute(IsNullable:=true)> _
Public Property details() As ElectroniceDetail()
Get
Return Me.detailsField
End Get
Set
Me.detailsField = value
End Set
End Property
.
.
.
End Class


Partial Public Class ElectroniceDetai
.
.
.
Public Property DW() As String
Get
Return Me.dwField
End Get
Set
Me.dwField = value
End Set
End Property
.
.
.

End Class

End Namespace


然后,在 Form1_Load
dim e_info as new ElectroniceInfo
dim e_detail as new ElectroniceDetai
e_detail.DW='test'
e_info. details=e_detail (运行到这里出错!) “未将对象引用设置到对象的实例”

另用 e_info.details.sevalue(e_detail,0), 也是这个出错!
现在想问一下 如何给 e_info.details 赋值呢?
...全文
345 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Tiger_Zhao 2017-03-14
  • 打赏
  • 举报
回复
攻关方向:java 和 .Net 对象默认序列化出来的 xml 应该不一样。
你需要在 .Net 类中实现自定义的序列化,使得和 java 结果一致。
blueapple0750 2017-03-14
  • 打赏
  • 举报
回复
晕,我叫他们搞一个.net的调用,现在也没有搞一个出来
Tiger_Zhao 2017-03-14
  • 打赏
  • 举报
回复
开发者都不保证能被.Net调用,你凭什么调用?
blueapple0750 2017-03-14
  • 打赏
  • 举报
回复
他只有JAVA的
Tiger_Zhao 2017-03-14
  • 打赏
  • 举报
回复
你用谁的webserivcs就问谁去。
要调用样例。
blueapple0750 2017-03-14
  • 打赏
  • 举报
回复
两个类是vs2005 引用别人的webserivcs自动生成的。
xdashewan 2017-03-14
  • 打赏
  • 举报
回复
set不需要写参数吗?Set(value As ElectroniceDetai)

16,555

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧