C#:将文件从客户端传输到服务器 [英] C# : Transferring files from Client to Server

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

问题描述

有人能指出我正确的方向吗? - 我正在尝试用C#编写一个简单的

云备份系统。



现在我有一个客户端和服务器程序,可以发送回信息和

。我已经意识到,我将不得不学习线程,或者后台工作人员,以便服务器可以更新GUI,这样我就可以看到它是什么了。 b $ b实际上正在进行 - 这似乎很快就过了我的脑袋。



我读过的文章说使用简单的线程,其他文章说我的b $ b应该使用异步套接字,其他文章建议我看看

进入网络流。



所以我不重新发明轮子,它是最新的.NET

完成这项任务的方式?



(对不起 - 我知道'广泛,基本上我希望有人能指出

我的方向)

Can someone point me in the right direction? - I am trying to write a simple
cloud backup system in C#.

Right now I have a client and server program, that can send messages back and
forth. What I have realized, is I am going to have to learn about threading, or
background worker, so that the server can update the GUI so I can see what it''s
actually working on - and this seems to be getting over my head quite quickly.

I''ve read articles saying to use simple Threading, other articles saying I
should be using Asynchronous sockets, other articles suggesting I look
into "Network Stream".

So that I don''t re-invent the wheel, what it the most up to date .NET
way of accomplishing this task?

(Sorry - I know that''s broad, basically I am hoping someone will point
me in a direction)

推荐答案

我觉得你需要用铅笔坐下来做一些''设计''/决定工作首先



i)你想备份一些文件

a)哪些文件 - 其中
b)文件的数据/安全分类是什么 - 这会影响它们的传输/存储方式吗?

ii)云服务器/服务

a)哪个云?

b)这个云提供API'/ SDK吗?这给你带来了什么 - 例如测试程序?

c)云服务是否提供了接收/存储与您期望的点匹配的数据的方式(i,b)??

d)你的
I think you need to sit down with a pad a pencil and do some ''design''/decision work first

i) You want to backup some files
a) which files - where
b) what is the data/security classification of the files - will this impact how they should be transmitted/stored ?
ii) to a cloud server/service
a) which cloud ?
b) does this cloud offer API''s/a SDK ?? what does that give you - test programs for example ?
c) does the cloud services offer ways of receiving/storing data that match what you expect from point (i,b) ??
d) what is your

是什么?


存储预算?

iii)你想要一个gui界面

你想要什么界面做什么

a )选择文件

b)显示进度 - 如何? listbox / ??



通常你会发现,例如亚马逊,当你注册成为开发者时,他们会给你很多东西 - 如果你''重新开始这个领域,通过他们的例子工作,即使他们有控制台模式程序,使用这些,然后开始考虑gui - 当我正在寻找新服务时,我很少从gui方面开始 - 如果你对于编程很新,有很多东西在gui中可能会模糊你需要做什么与云谈话api



你的选择''云'' - 查看(ii)下的那些点然后可以推动更多的决定/选项



btw ..客户端服务器..在你的情况下,客户端可能是在本地计算机/ PC上运行的程序,服务器是云服务器,即允许您上传,存储等服务到云服务的服务 - 我在考虑''客户端 - 服务器' '编程在你的cas中有点过早/错误e $>




很遗憾,我会指出这个论坛是为了快速回答 - 这真的意味着你必须有特定的位你需要帮助的代码/问题,而不是像这样广泛的东西 - 所以你很可能得到广泛的答案



''g''
budget for storage ?
iii) you want a gui interface
what do you want the interface to do
a) select files
b) show progress - how ? listbox/??

Often you''ll find eg for Amazon, there are heaps of stuff they give you when you sign up as a developer - if you''re new to this field, work your way through their examples, even if they have console mode programs, use these and then start thinking about a gui - I rarely start with the gui side when Im looking at talking to a new service - if you''re new to programming, there''s a lot going on in a gui that may obscure what you need to to do talk to the cloud api

Your choice about ''which cloud'' - looking at those points under (ii) may then drive more decisions/options

btw .. client-server .. in your case, the client is likely the program running on your local machine/pc, the server is the ''cloud'' server ie the services that allow you to upload, store etc to a cloud service - I thinking looking at ''client-server'' programming is a bit premature/wrong in your case


Lastely, I''d point out that this forum is for quick answers - that really means you have to have specific bits of code/questions you need help with, not something broad like this - so you''re likely to get broad answers

''g''


在另一个网站上找到解决方案,无论如何。
Found the solution on another site, thanks anyway.


这篇关于C#:将文件从客户端传输到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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