如何将Visual Basic中的代码转换为C#
这是VB.NET中的代码:如何将Visual Basic中的代码转换为C#,c#,.net,vb.net,vb.net-to-c#,C#,.net,Vb.net,Vb.net To C#,这是VB.NET中的代码: Protected Overrides ReadOnly Property CreateParams() As CreateParams Get Dim CP As CreateParams = MyBase.CreateParams CP.Style = &HA0000 Return CP End Get 我想把它转换成C。根据我下面的假设,C#中的代码是什么样子的。对于上面的代码,其中CP.
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim CP As CreateParams = MyBase.CreateParams
CP.Style = &HA0000
Return CP
End Get
我想把它转换成C。根据我下面的假设,C#中的代码是什么样子的。对于上面的代码,其中CP.Style=&HA000
,我应该输入什么
C代码。我把它空了
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.Style =
return cp;
}
}
你需要:
CreateParams cp = base.CreateParams;
cp.Style = 0xA000;
return cp;
0x
是C#中十六进制整数文本的前缀,而不是VB中的&H
。您需要:
CreateParams cp = base.CreateParams;
cp.Style = 0xA000;
return cp;
protected override CreateParams CreateParams {
get {
CreateParams CP = base.CreateParams;
CP.Style = 0xa0000;
return CP;
}
}
0x
是C#中十六进制整数文本的前缀,而不是VB中的&H
protected override CreateParams CreateParams {
get {
CreateParams CP = base.CreateParams;
CP.Style = 0xa0000;
return CP;
}
}
缺行:
cp.Style = 0xA0000;
缺行:
cp.Style = 0xA0000;
一种通用的方法是编译代码,然后在中进行反汇编。请注意,reflector很快就会停止使用,一种通用的方法是编译代码,然后在中进行反汇编。请注意,反射器将很快停止空闲。