首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

VB.NET里面的简单二小个有关问题

2012-03-31 
VB.NET里面的简单二小个问题1:VB.NET codeProtected Property id()GetEnd GetSet(ByVal value)End SetEnd

VB.NET里面的简单二小个问题

1:

 

VB.NET code
  Protected Property id()        Get        End Get        Set(ByVal value)        End Set    End Property


怎么样写完整
这个怎么用啊, 怎么调到Get方法和Set方法  


2 VB.NET怎么样强制类型转换啊??

java中是: int aa = (int)11.1

vb.net 应该怎么写啊

[解决办法]
第一个我记不太清楚了,

回答一下第二个

VB.NET code
int aa = CInt(11.1)
[解决办法]
第一个试试这样行不.
VB.NET code
Private Kabuid As String Public Property id() As String Get Return Kabuid End Get Set(ByVal value As String) Kabuid = value End Set
[解决办法]
第一个是设置一个类的属性,像text控件的text属性一样
Protected Property id()
Get
return id
End Get
Set(ByVal value)
id=value
End Set
End Property
y就可以用了
[解决办法]
探讨
引用:
第一个我记不太清楚了,

回答一下第二个


VB.NET codeint aa = CInt(11.1)


我的是自定义类咯,这边只是举个例子,而已

[解决办法]
这个~~~东西,叫结构~~~吧~我是来打酱油的
[解决办法]
VB.NET code
Public Class aa    Private user As String    Public Property use()        Get            Return user        End Get        Set(ByVal value)            user = value        End Set    End PropertyEnd ClassPublic Class bb    Public Sub check()        Dim a As New aa        a.use = "abc"        Debug.Print(a.use)    End SubEnd Class
[解决办法]
VB.NET怎么样强制类型转换啊??

java中是: int aa = (int)11.1 

VB.NET CODE:
Dim aa As Integer = CType(11.1, Integer)
[解决办法]
Dim a As Integer = Int(11.1)
Dim b As Integer = CInt(11.1)
Dim c As Integer = CType(11.1, Integer)
Dim d As Integer = Convert.ToInt32(11.1)
Dim f As Integer = Val(11.1)
[解决办法]
探讨
Dim a As Integer = Int(11.1)
Dim b As Integer = CInt(11.1)
Dim c As Integer = CType(11.1, Integer)
Dim d As Integer = Convert.ToInt32(11.1)
Dim f As Integer = Val(11.1)

热点排行