我可以将从套接字接收的数据直接映射到VB.NET中的结构 [英] Can I map the data received from a socket directly to a structure in VB.NET

查看:51
本文介绍了我可以将从套接字接收的数据直接映射到VB.NET中的结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,


我是VB.Net编程的新手,直接进行套接字编程。在C中,我
将能够将到达套接字的消息直接映射到结构。

这在VB.Net中是否可行。有谁可以帮我一些样品

编码和指导?


你能否建议一些其他新闻组可用于套接字编程
$ b VB.Net中的$ b?


我的TCP / IP服务器程序是在C中完成的。我必须在VB中创建一个TCP / IP客户端

socket .Net并在服务器和客户端之间传输一些数据。发送的

数据应该是带有标题和正文的预定义结构。

根据标题中的消息类型,我必须映射到达的

消息到相应的结构。我在C中完成了这个,但是不知道在VB.Net中实现的
。请指导我。


提前致谢,

Uma

Hai,

I am new to VB.Net programming, directly doing socket programming. In C, I
will be able to map the message arrived in a socket directly to a structure.
Is this possible in VB.Net. Can anyone please help me with some sample
codings and guidance?

Can you also suggest some other news group available for socket programming
in VB.Net?

My TCP/IP server program is done in C. I have to create a TCP/IP client
socket in VB.Net and transfer some data between the server and client. The
data sent should be in predefined structure with a header and body.
Depending on the Message Type in the header, I have to map the arrived
message to the corresponing structure. I have done this in C, but not aware
of implementing in VB.Net. Please guide me.

Thanks in advance,
Uma

推荐答案

是Uma,实际上你可以通过

套接字直接序列化对象。您可以使用Networkstream和

Formatter来实现这一目标。这个过程只是将对象序列化为

一个字节数组,发送它,并在另一端反序列化它。


-tom

Uma - Chellasoft ha scritto:
Yes Uma, actually you can directly serialize objects through the
socket. It''s quite easy you can just use a Networkstream and a
Formatter to do that. The process is simply to serialize the object to
an array of bytes, send it, and deserialize it on the other end.

-tom

Uma - Chellasoft ha scritto:

Hai,


我是VB新手.Net编程,直接进行套接字编程。在C中,我
将能够将到达套接字的消息直接映射到结构。

这在VB.Net中是否可行。有谁可以帮我一些样品

编码和指导?


你能否建议一些其他新闻组可用于套接字编程
$ b VB.Net中的$ b?


我的TCP / IP服务器程序是在C中完成的。我必须在VB中创建一个TCP / IP客户端

socket .Net并在服务器和客户端之间传输一些数据。发送的

数据应该是带有标题和正文的预定义结构。

根据标题中的消息类型,我必须映射到达的

消息到相应的结构。我在C中完成了这个,但是不知道在VB.Net中实现的
。请指导我。


提前致谢,

Uma
Hai,

I am new to VB.Net programming, directly doing socket programming. In C, I
will be able to map the message arrived in a socket directly to a structure.
Is this possible in VB.Net. Can anyone please help me with some sample
codings and guidance?

Can you also suggest some other news group available for socket programming
in VB.Net?

My TCP/IP server program is done in C. I have to create a TCP/IP client
socket in VB.Net and transfer some data between the server and client. The
data sent should be in predefined structure with a header and body.
Depending on the Message Type in the header, I have to map the arrived
message to the corresponing structure. I have done this in C, but not aware
of implementing in VB.Net. Please guide me.

Thanks in advance,
Uma




感谢您使用Networkstream和Formatter的指导。但即使看了一下

Networkstream,我也无法得到确切的解决方案。如果时间允许的话,请你给我一个示例代码,用于将
的二进制消息从套接字直接映射到VB.Net中的结构。


问候,

Uma


<到************** @ uniroma1.itwrote in message

news:11 ********************* @ m79g2000cwm.googlegro ups.com ...

Thanks for your guidance for using Networkstream and Formatter. But I am
unable to come out with the exact solution even after having a look at
Networkstream. If time permits, can you please give me a sample code for
mapping the binary message from a socket directly to a structure in VB.Net.

Regards,
Uma

<to**************@uniroma1.itwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...

是Uma,实际上你可以通过

套接字直接序列化对象。您可以使用Networkstream和

Formatter来实现这一目标。这个过程只是将对象序列化为

一个字节数组,发送它,并在另一端反序列化它。


-tom

Uma - Chellasoft ha scritto:
Yes Uma, actually you can directly serialize objects through the
socket. It''s quite easy you can just use a Networkstream and a
Formatter to do that. The process is simply to serialize the object to
an array of bytes, send it, and deserialize it on the other end.

-tom

Uma - Chellasoft ha scritto:

> Hai,

我是VB.Net的新手编程,直接进行套接字编程。在C中,
我将能够将到达套接字的消息直接映射到
结构。
这可能在VB.Net中。有谁可以帮我提供一些样本编码和指导?

你能否在VB.Net上建议一些其他新闻组可用于插件编程?

我的TCP / IP服务器程序是在C中完成的。我必须在VB.Net中创建一个TCP / IP客户端
套接字,并在服务器和客户端之间传输一些数据。
发送的数据应该是预定义的结构,带有标题和正文。
根据标题中的消息类型,我必须将到达的
消息映射到相应的结构。我在C中完成了这个,但没有意识到在VB.Net中实现。请指导我。

提前致谢,
Uma
>Hai,

I am new to VB.Net programming, directly doing socket programming. In C,
I
will be able to map the message arrived in a socket directly to a
structure.
Is this possible in VB.Net. Can anyone please help me with some sample
codings and guidance?

Can you also suggest some other news group available for socket
programming
in VB.Net?

My TCP/IP server program is done in C. I have to create a TCP/IP client
socket in VB.Net and transfer some data between the server and client.
The
data sent should be in predefined structure with a header and body.
Depending on the Message Type in the header, I have to map the arrived
message to the corresponing structure. I have done this in C, but not
aware
of implementing in VB.Net. Please guide me.

Thanks in advance,
Uma



您好,


UMA,目前我有点不知所措(我在

汇编之间回复)但我找到了一些代码链接:

http://www.ureader.com/message/1084726。 aspx
http://www.developmentnow.com/g/4_20...ket-stream.htm
http://www.thescripts.com/forum/thread381461.html


如果您遇到问题,请告诉我们。如果没有效果,我会在一段时间后试着写完你的课程。 Ciao,


-Tommaso


Uma - Chellasoft ha scritto:
Hello,

UMA, at the moment I am a little overwhelmed (I am replying between
compilations) but I found a few links with code:

http://www.ureader.com/message/1084726.aspx
http://www.developmentnow.com/g/4_20...ket-stream.htm
http://www.thescripts.com/forum/thread381461.html

if you have problems let us know. If none works, I will try to spare
some time later to write your classes. Ciao,

-Tommaso

Uma - Chellasoft ha scritto:

感谢您使用Networkstream和Formatter的指导。但即使看了一下

Networkstream,我也无法得到确切的解决方案。如果时间允许的话,请你给我一个示例代码,用于将
的二进制消息从套接字直接映射到VB.Net中的结构。


问候,

Uma


<到************** @ uniroma1.itwrote in message

news:11 ********************* @ m79g2000cwm.googlegro ups.com ...
Thanks for your guidance for using Networkstream and Formatter. But I am
unable to come out with the exact solution even after having a look at
Networkstream. If time permits, can you please give me a sample code for
mapping the binary message from a socket directly to a structure in VB.Net.

Regards,
Uma

<to**************@uniroma1.itwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...

是Uma,实际上你可以通过

套接字直接序列化对象。您可以使用Networkstream和

Formatter来实现这一目标。这个过程只是将对象序列化为

一个字节数组,发送它,并在另一端反序列化它。


-tom

Uma - Chellasoft ha scritto:
Yes Uma, actually you can directly serialize objects through the
socket. It''s quite easy you can just use a Networkstream and a
Formatter to do that. The process is simply to serialize the object to
an array of bytes, send it, and deserialize it on the other end.

-tom

Uma - Chellasoft ha scritto:

Hai,


我是VB新手.Net编程,直接进行套接字编程。在C,



将能够将到达套接字的消息直接映射到

结构。

这可能在VB.Net中。有谁可以帮我一些样品

编码和指导?


你能否建议一些其他新闻组可用于插座

编程
VB.Net中的


我的TCP / IP服务器程序是在C中完成的。我必须创建一个TCP / IP客户端

VB.Net中的套接字并在服务器和客户端之间传输一些数据。

发送的

数据应该是带有标题和正文的预定义结构。

根据标题中的消息类型,我必须将到达的

消息映射到相应的结构。我在C中完成了这个,但没有意识到在VB.Net中实现的
。请指导我。


在此先感谢,

Uma
Hai,

I am new to VB.Net programming, directly doing socket programming. In C,
I
will be able to map the message arrived in a socket directly to a
structure.
Is this possible in VB.Net. Can anyone please help me with some sample
codings and guidance?

Can you also suggest some other news group available for socket
programming
in VB.Net?

My TCP/IP server program is done in C. I have to create a TCP/IP client
socket in VB.Net and transfer some data between the server and client.
The
data sent should be in predefined structure with a header and body.
Depending on the Message Type in the header, I have to map the arrived
message to the corresponing structure. I have done this in C, but not
aware
of implementing in VB.Net. Please guide me.

Thanks in advance,
Uma


这篇关于我可以将从套接字接收的数据直接映射到VB.NET中的结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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