newbee需要帮助代码 [英] newbee need help with code

查看:77
本文介绍了newbee需要帮助代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有人可以将以下c#代码翻译成Vb.Net吗?


byte [] myData = new byte [nFileLen ];


我试过了


Dim myData As Byte()= New Byte(nFileLen)


不编译,错误信息:

类型''byte''没有构造函数。


TIA


Hi,

Can somebody translate the following c# code into Vb.Net?

byte[] myData = new byte[nFileLen];

I tried

Dim myData As Byte() = New Byte(nFileLen)

Does not compile , with error message:
Type ''byte'' has no constructors.

TIA


推荐答案

dim myData(nFileLen-1)as byte


" Danny Ni" < dn*@yahoo.com> escribióenel mensaje

news:uZ ************** @ tk2msftngp13.phx.gbl ...
dim myData(nFileLen-1) as byte

"Danny Ni" <dn*@yahoo.com> escribió en el mensaje
news:uZ**************@tk2msftngp13.phx.gbl...


有人可以将以下c#代码翻译成Vb.Net吗?

byte [] myData = new byte [nFileLen];

我试过

Dim myData As Byte()= New Byte(nFileLen)

不编译,错误信息:
类型''byte''没有构造函数。

TIA
Hi,

Can somebody translate the following c# code into Vb.Net?

byte[] myData = new byte[nFileLen];

I tried

Dim myData As Byte() = New Byte(nFileLen)

Does not compile , with error message:
Type ''byte'' has no constructors.

TIA



" Danny Ni" < dn*@yahoo.com> schrieb:
"Danny Ni" <dn*@yahoo.com> schrieb:
有人可以将以下c#代码翻译成Vb.Net吗?

byte [] myData = new byte [nFileLen];

我尝试将文件调暗为Byte()=新字节(nFileLen)

不编译,错误信息:
类型''byte''没有构造函数。
Can somebody translate the following c# code into Vb.Net?

byte[] myData = new byte[nFileLen];

I tried

Dim myData As Byte() = New Byte(nFileLen)

Does not compile , with error message:
Type ''byte'' has no constructors.




我会选择alejandro发布的解决方案。但是,您可以使上面的

代码稍作改动:


\\\

Dim FileLen As Integer = 22

Dim MyData1 As Byte()= New Byte(FileLen - 1){}

Dim MyData3()By Byte = New Byte(FileLen - 1) {}

Dim MyData4(FileLen - 1)As Byte

///


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http:// dotnet .mvps.org / dotnet / faqs />



I would choose the solution posted by alejandro. However, you can make the
code above work with a little change:

\\\
Dim FileLen As Integer = 22
Dim MyData1 As Byte() = New Byte(FileLen - 1) {}
Dim MyData3() As Byte = New Byte(FileLen - 1) {}
Dim MyData4(FileLen - 1) As Byte
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


Dim myData(nFileLen)As Byte


" ; Herfried K. Wagner [MVP]"写道:
Dim myData(nFileLen) As Byte

"Herfried K. Wagner [MVP]" wrote:
" Danny Ni" < dn*@yahoo.com> schrieb:
"Danny Ni" <dn*@yahoo.com> schrieb:
有人可以将以下c#代码翻译成Vb.Net吗?

byte [] myData = new byte [nFileLen];

我尝试将文件调暗为Byte()=新字节(nFileLen)

不编译,错误信息:
类型''byte''没有构造函数。
Can somebody translate the following c# code into Vb.Net?

byte[] myData = new byte[nFileLen];

I tried

Dim myData As Byte() = New Byte(nFileLen)

Does not compile , with error message:
Type ''byte'' has no constructors.



我会选择alejandro发布的解决方案。但是,您可以稍微改变上面的代码:

\\\
Dim FileLen As Integer = 22
Dim MyData1 As Byte ()=新字节(FileLen - 1){}
Dim MyData3()As Byte = New Byte(FileLen - 1){}
Dim MyData4(FileLen - 1)As Byte
/ //

- MS Herfried K. Wagner
MVP< URL:http://dotnet.mvps.org/>
VB< URL :http://dotnet.mvps.org/dotnet/faqs/>



I would choose the solution posted by alejandro. However, you can make the
code above work with a little change:

\\\
Dim FileLen As Integer = 22
Dim MyData1 As Byte() = New Byte(FileLen - 1) {}
Dim MyData3() As Byte = New Byte(FileLen - 1) {}
Dim MyData4(FileLen - 1) As Byte
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>



这篇关于newbee需要帮助代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆