char [4]用于存储IP的数据类型 - VB.NET等价 [英] char[4] data type in c for storing IPs - VB.NET equivalence

查看:98
本文介绍了char [4]用于存储IP的数据类型 - VB.NET等价的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:

我从dll的文档中读到有一个结构使用

char [4]来存储IP地址。怎么会这样?为什么我能得到

表示字符串VB.NET数据类型中的相同值,知道这个

是它的等价(对于char4)?

接下来是数据类型定义

'''''unsigned char [4]


< System.Runtime.InteropServices。 MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByVa lTStr,SizeConst:= 4)_


Public IP As String


非常感谢为了你的帮助!

-

Emilio Javier Leyes

T ?? cnico Universitario en Inform ?? tica

Sistema de Emergencias 911

萨尔塔,阿根廷

Hi everyone:
i read from the documentation of a dll that there is a struct that uses
char[4] for storing an IP address. How can it be? and how come i can get to
representate the same value in a string VB.NET data type, knowing that this
is its equivalence (for char4)?
Next is the data type definition
''''''unsigned char[4]

<System.Runtime.InteropServices.MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType.ByVa lTStr, SizeConst:=4)_

Public IP As String

Thanks very much for your help!
--
Emilio Javier Leyes
T??cnico Universitario en Inform??tica
Sistema de Emergencias 911
Salta, Argentina

推荐答案

''unsigned char''是VB中的字节。 />
例如,相当于以下C ++:

unsigned char test [4];

是:

昏暗测试(3)As Byte

-
http:/ /www.tang iblesoftwaresolutions.com

C ++到C#

C ++到VB

C ++到Java

VB& ; C#to Java

Java to VB& C#

即时C#:VB到C#

即时VB:C#到VB

即时C ++:VB,C#或Java到C ++ / CLI

" emitojleyes"写道:
''unsigned char'' is Byte in VB.
As an example, the equivalent to the following C++:
unsigned char test[4];
is:
Dim test(3) As Byte
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
"emitojleyes" wrote:

大家好:

i从dll的文档中读取有一个结构使用

char [4]用于存储IP地址。怎么会这样?为什么我能得到

表示字符串VB.NET数据类型中的相同值,知道这个

是它的等价(对于char4)?

接下来是数据类型定义


'''''unsigned char [4]


< System。 Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByVa lTStr,SizeConst:= 4)_


Public IP As String


非常感谢你的帮助!

-

Emilio Javier Leyes

T ?? cnico Universitario en Inform ?? tica

Sistema de Emergencias 911

萨尔塔,阿根廷
Hi everyone:
i read from the documentation of a dll that there is a struct that uses
char[4] for storing an IP address. How can it be? and how come i can get to
representate the same value in a string VB.NET data type, knowing that this
is its equivalence (for char4)?
Next is the data type definition
''''''unsigned char[4]

<System.Runtime.InteropServices.MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType.ByVa lTStr, SizeConst:=4)_

Public IP As String

Thanks very much for your help!
--
Emilio Javier Leyes
T??cnico Universitario en Inform??tica
Sistema de Emergencias 911
Salta, Argentina


嗨大卫,非常感谢您的回复。

我在vb.net中做了什么,实际上我并没有这样做。我在
中使用了一个应用程序

http://blogs.msdn.com/vbteam/archive...voke-easy.aspx ,

显然帮助了我很多,因为,在这个问题之前,我得到了一个错误,并且找不到解决方案。

现在,你说数据类型必须是字节。 ..那么,我应该写什么价值

以下的ip地址,例如:192.168.010.008?

我尝试用字符串替换字符串:

< System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByVa lTStr,SizeConst:= 4)>,但是我收到了错误...

如何我可以继续吗?再次感谢大卫。

-

Emilio Javier Leyes

T ?? cnico Universitario en Inform ?? tica

Sistema de Emergencias 911

阿根廷萨尔塔

David Anton写道:
Hi david, and thanks very muuch for your reply.
What i worte in vb.net, actually i didn''t do it. I used an application
avaiable in
http://blogs.msdn.com/vbteam/archive...voke-easy.aspx,
that apparently helped me a lot, because, before this problem, i was getting
an error and couldn''t find the solution.
Now, you say the data type must be byte... so, what value should i write for
the following ip address, for example: 192.168.010.008?
I tried replacing string for byte in:
<System.Runtime.InteropServices.MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType.ByVa lTStr, SizeConst:=4)>, but i got an error...
How can i continue? Thanks again david.
--
Emilio Javier Leyes
T??cnico Universitario en Inform??tica
Sistema de Emergencias 911
Salta, Argentina
"David Anton" wrote:

''unsigned char''是VB中的字节。

例如,相当于以下C ++:

unsigned char test [4];

是:

Dim test(3)As Byte

-
http://www.tangiblesoftwaresolutions.com

C ++到C#

C ++到VB

C ++到Java

VB& C#to Java

Java to VB& C#

即时C#:VB到C#

即时VB:C#到VB

即时C ++:VB,C#或Java到C ++ / CLI


" emitojleyes"写道:
''unsigned char'' is Byte in VB.
As an example, the equivalent to the following C++:
unsigned char test[4];
is:
Dim test(3) As Byte
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++/CLI
"emitojleyes" wrote:

大家好:

i从dll的文档中读取有一个结构使用

char [4]用于存储IP地址。怎么会这样?为什么我能得到

表示字符串VB.NET数据类型中的相同值,知道这个

是它的等价(对于char4)?

接下来是数据类型定义

''''''unsigned char [4]
Hi everyone:
i read from the documentation of a dll that there is a struct that uses
char[4] for storing an IP address. How can it be? and how come i can get to
representate the same value in a string VB.NET data type, knowing that this
is its equivalence (for char4)?
Next is the data type definition
''''''unsigned char[4]



< System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByVa lTStr,SizeConst:= 4)_

<System.Runtime.InteropServices.MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType.ByVa lTStr, SizeConst:=4)_



公共IP字符串


非常感谢您的帮助!

-

Emilio Javier Leyes

T ?? cnico Universitario en Inform ?? tica

Sistema de Emergencias 911

萨尔塔,阿根廷

Public IP As String

Thanks very much for your help!
--
Emilio Javier Leyes
T??cnico Universitario en Inform??tica
Sistema de Emergencias 911
Salta, Argentina


emitojleyes写道:
emitojleyes wrote:

嗨大卫,非常感谢您的回复。

我在vb.net中做了什么,实际上我并没有这样做。我在
中使用了一个应用程序

http://blogs.msdn.com/vbteam/archive...voke-easy.aspx ,

显然帮助了我很多,因为,在这个问题之前,我得到了一个错误,并且找不到解决方案。

现在,你说数据类型必须是字节。 ..那么,我应该为

写下以下ip地址的价值,例如:192.168.010.008?
Hi david, and thanks very muuch for your reply.
What i worte in vb.net, actually i didn''t do it. I used an application
avaiable in
http://blogs.msdn.com/vbteam/archive...voke-easy.aspx,
that apparently helped me a lot, because, before this problem, i was getting
an error and couldn''t find the solution.
Now, you say the data type must be byte... so, what value should i write for
the following ip address, for example: 192.168.010.008?



新字节(){192,168,10,8}

New Byte() { 192, 168, 10, 8 }


我试过替换字符串byte in:

< System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByVa lTStr,SizeConst:= 4)>,但我收到错误...

我该如何继续?再次感谢大卫。
I tried replacing string for byte in:
<System.Runtime.InteropServices.MarshalAsAttribute (System.Runtime.InteropServices.UnmanagedType.ByVa lTStr, SizeConst:=4)>, but i got an error...
How can i continue? Thanks again david.



你想要一个大小为4的字节数组,所以它应该是这样的:


< MarshalAsAttribute(UnmanagedType) .LPArray,SizeConst:= 4,

ArraySubType:= UnmanagedType.U1>


-

G ??跑Andersson

_____
http://www.guffa.com


这篇关于char [4]用于存储IP的数据类型 - VB.NET等价的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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