将文件从一个文件夹移动到acp.net Web应用程序中的另一个文件夹 [英] Move file from one folder to another folder in acp.net web applicatin

查看:85
本文介绍了将文件从一个文件夹移动到acp.net Web应用程序中的另一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在应用程序中将文件r图像从一个文件夹移动到另一个文件夹...

how to move file r image from one folder to another folder with in a application...

推荐答案

以下示例显示了如何移动文件和目录.

//没有用户界面的简单同步文件移动操作.
The following example shows how to move files and directories.

// Simple synchronous file move operations with no user interface.
public class SimpleFileMove
{
    static void Main()
    {
        string sourceFile = @"C:\Users\Public\public\test.txt";
        string destinationFile = @"C:\Users\Public\private\test.txt";

        // To move a file or folder to a new location:
        System.IO.File.Move(sourceFile, destinationFile);

        // To move an entire directory. To programmatically modify or combine // path strings, use the System.IO.Path class.
        System.IO.Directory.Move(@"C:\Users\Public\public\test\", @"C:\Users\Public\private");
    }
}


使用此方法
System.IO.Directory.Move(源文件名,目标文件名);
use this method
System.IO.Directory.Move(sourcefilename,destinationfilename);


这篇关于将文件从一个文件夹移动到acp.net Web应用程序中的另一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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