.net 通过用户名密码访问共享文件夹

这是引用的命名空间(有一部分是不需要的,可以自行去掉)

using Oracle.DataAccess.Client;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Text;
using EMPPLib;
using System.Threading;
using log4net;
using System.IO;
using System.Net;
using System.Web;
using System.Runtime.InteropServices;

 string HttpDownloadFile(string url, string path, string path2)
        {
            try
            {
                //获取文件目录,若不存在则创建
                string date = DateTime.Now.ToString("yyyyMMdd");
                path2 += date;
                if (!Directory.Exists(path2))
                {
                    Directory.CreateDirectory(path2);
                }
                string fileName = Path.GetFileName(url); // 获取源文件名  
                string timestamp = DateTime.Now.ToString("yyyyMMddHHmmss"); // 生成时间戳  
                newNa

你可能感兴趣的:(.NET,跨域,.net)