使用C#创建,删除,修改网络路径的内容? [英] create , delete , modify the contain of a network path using c#?

查看:202
本文介绍了使用C#创建,删除,修改网络路径的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我正在开发一些将安装在多个客户端上的应用程序.每个客户端都可以连接到服务器上的SQL数据库并修改其内容.我正在寻找一种方法,使客户端可以使用此应用程序复制服务器存储上的某些文件,但不能使用Windows资源管理器或外部程序来复制文件.我怎样才能做到这一点?如果不可能,客户端如何告诉服务器将其文件复制到服务器存储中?

感谢您的回答.

Hi I am developing some application that will be installed on multiple clients. Each client can connect to a SQL database on the server and modify its contents. I am looking a way that clients can copy some files on the server storage using this application, but can not do that using windows explorer or external program. How can I do that? if this is not possible, how can clients tell server to copy their files to the server storage?

Thanks for your answers .

推荐答案

您可以在服务器计算机上设置FTP服务器,并为每个客户端提供一个上载文件的帐户. .Net有一个您也可以使用的FTP对象.
You can setup a FTP server on the server machine, and give each client an account to upload files. .Net has a FTP object you can use as well.


一种可能性是使用 ^ ]执行DOS命令,例如复制".
One possibility is to use the xp_cmdshell command[^] to execute a DOS command, ''Copy'' for example.


您好,


您的问题有点不清楚,您是否要将文件复制到服务器共享或作为数据库中的Blob?

如果要复制共享中的文件,则可以使用File类:

Hello,


Your question is a bit unclear do you want to copy files to a server share, or as a blob in your database?

if you want to copy files in a share, You could use the File class:

System.IO.File.Copy(@"c:\myfile.txt", @"\\server\share\myfile.txt");



如果要将文件复制到数据库,请参阅本文,向您展示如何处理BLOB.

使用ASP.NET 2.0在SQL Server 2000和2005中以BLOB的形式存储和检索对象 [ ^ ]

瓦莱里(Valery)



If you want to copy your files to database have a look at this article showing you how to deal with BLOBs

Store and retrieve objects as BLOBs in SQL Server 2000 and 2005 using ASP.NET 2.0[^]

Valery


这篇关于使用C#创建,删除,修改网络路径的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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