使用客户端服务器编程如何将对象中的值从客户端传递到服务器 [英] using client server programming how passing value in object from client to server

查看:57
本文介绍了使用客户端服务器编程如何将对象中的值从客户端传递到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

请告诉我我如何制作客户端服务器程序.
和客户端编码,如果我有值(exe:-"12546987"),则为字符串格式.现在我想在服务器端读取该值.但是当我当时将该值从客户端发送到服务器时,我想以对象的形式传递该值.


因此,请请求我答复.

sir,

please tell me how i make the client server program.
and client side coding if i have the value(exe:-"12546987") it is in string format. now i want to read that value at server side.but when i am sending that value from client to server at that time i want to pass that value in form of object.


so please i request to you reply me.

推荐答案

设计您的对象,然后将值序列化为它(这可以是一个简单的整数-4字节值)并发送它到服务器.在服务器端,只需反序列化它,便拥有原始值.
Design your object and then serialise the value into it (this could be a simple integer - 4 byte value) and send it to the server. At the server end just deserialise it and you have the original value.


这篇关于使用客户端服务器编程如何将对象中的值从客户端传递到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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