从c#应用程序上传数据到Internet [英] Uploading data to the internet from a c# application

查看:127
本文介绍了从c#应用程序上传数据到Internet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一款游戏,希望能够通过c#程序快速上传大量数字到网页。我也需要程序能够接收该数组。现在该程序将如何显示以及网页将如何显示?如果这个问题没有意义,请发表评论,我会尽快更新。谢谢。

解决方案

非常广泛的问题。



'网页'在哪里存储数据?您可能希望使用某种Web服务来执行此操作。



我建议使用HTTP POST发送数据。你可以选择如何继续,你可以使用.NET中的内置序列化,但是如果有很多数据,我建议编写自己的代码(由HTTPWebRequest提供的附加到NetworkStream的BinaryWriter)以非常有效的方式工作)。



如果这对你没有任何意义,那么说实话,你会很难做到这一点。 / blockquote>

程序看起来像是你自己写的文字,取决于你的技能和编码风格。



网络页面将看起来你的设计方式,将取决于你的设计技巧和你的个人品味,无论好坏。



这是所有可以根据你的情况告诉不是很有用的问题。这个答案似乎没有任何意义,请尽快更新您的问题,并解释您的具体问题。 我不知道没有提供信息。在ASP.NET应用程序中上传数据(您必须标记它)是网站编程的基本琐事之一。基本上,您可以使用方法POST创建Web表单,也可以使用Ajax发布数据。服务器端代码获取发布的数据并以某种方式处理它。您没有提供任何细节,也没有显示您尝试做什么,出现了什么问题,等等。



-SA

I am making a game and want to be able to upload a huge array of numbers pretty fast to a web page from a c# program. I also so need the program to be able to receive that array. Now how would the program look like and how would the web page look like? If this question doesn't make sense please comment and I will update it as soon as possible. Thanks.

解决方案

Very broad question.

Where does the 'webpage' store its data? You probably want to use some sort of web service to do this.

I'd suggest sending the data using an HTTP POST. You have a choice here of how to proceed, you could use built-in serialisation found in .NET, but if there is a lot of data, I'd suggest writing your own code (a BinaryWriter attached to the NetworkStream presented by an HTTPWebRequest works in a very lean efficient manner).

If that doesn't mean anything to you, then in all honesty you're going to struggle to do this.


The program will look like you have written its text by yourself and will depends on your skills and coding styles.

The Web page will look the way you design it and will depend on your design skills and your personal taste, good or bad.

That is all which can be told based on your not very informative question. It this answer does not seem to make no sense, please update your question as soon as possible and explain your particular concerns. "I have no idea" is not informative. Uploading data in ASP.NET application (you had to tag it) is one of the basic chores of the Web site programming. Basically, you either create a Web form with the method "POST" or use Ajax to post data. The server-side code picks up the posted data and process it somehow. You did not provide any detail and did not show what did you try to do, what was the problem, and so on.

—SA


这篇关于从c#应用程序上传数据到Internet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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