如何保存文件在另一台机器在同一个网络中的C#? [英] how to save file in another machine in the same network in c#?

查看:192
本文介绍了如何保存文件在另一台机器在同一个网络中的C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要上传的文件保存到另一个本地机器。但是,我并不清楚如何使用模拟在我的code。

我使用了下列code。

 保护无效btnSave_Click(对象发件人,EventArgs的)
{
        INT结果为0,RESULT1 = 0;
        字符串attachmentpath =C:\\的Documents and Settings \\ pr84528 \\我的文档\\ PRABU \\ \\技术点网\\ DocumentManager \\附件\\;
.................................................. ..................................
.................................................. ..................................
如果(fuDocument.HasFile)
    fuDocument.SaveAs(attachmentpath + fuDocument.FileName);
.................................................. ..................................
.................................................. ..................................
}
 

解决方案

我觉得这里是您的解决方案。 的http://bytes.com/topic/net/answers/853352-create-text-file-network-path-using-c

I have to save the uploaded document into another local machine. But I was not clear how to use impersonation in my code.

I have used the following code.

protected void btnSave_Click(object sender, EventArgs e)
{
        int result = 0,result1=0;
        string attachmentpath = "C:\\Documents and Settings\\pr84528\\My Documents\\PRABU\\Tech\\Dot Net\\DocumentManager\\Attachments\\";
....................................................................................
....................................................................................
if(fuDocument.HasFile)
    fuDocument.SaveAs(attachmentpath + fuDocument.FileName);
....................................................................................
....................................................................................
}

解决方案

I think here is your solution. http://bytes.com/topic/net/answers/853352-create-text-file-network-path-using-c

这篇关于如何保存文件在另一台机器在同一个网络中的C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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