(2009-09-27 12:18:09)
<script> var $tag='it'; var $tag_code='eb65fb21463843ec4e092ddd6192fd7f'; var $r_quote_bligid='4d17d8ec0100f0ls'; var $worldcup='0'; var $worldcupball='0'; </script>标签: it |
分类: 软件开发 |
以下程序在.NET2005,系统XP中测试通过:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;
namespace TQSystem.Com
{
class UpDownLoadFile
{
/// <summary>
/// WebClient上传文件至服务器(不带进度条)
/// </summary>
/// <param name="fileNameFullPath">要上传的文件(全路径格式)</param>
/// <param name="strUrlDirPath">Web服务器文件夹路径</param>
/// <returns>True/False是否上传成功</returns>
public bool UpLoadFile(string fileNameFullPath, string strUrlDirPath)
{
//得到要上传的文件文件名
string fileName = fileNameFullPath.Substring(fileNameFullPath.LastIndexOf("\\") + 1);
//新文件名由年月日时分秒及毫秒组成