DownloadFileInfo file = e.UserState as DownloadFileInfo;
            nDownloadedTotal += file.Size;
            this.SetProcessBar(0, (int)(nDownloadedTotal * 100 / total));
            //Debug.WriteLine(String.Format("Finish Download:{0}", file.FileName));
            //替换现有文件
            string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, file.FileFullName);
            if (File.Exists(filePath))
            {
                if (File.Exists(filePath + ".old"))
                    File.Delete(filePath + ".old");                File.Move(filePath, filePath + ".old");//这是从服务器上下载更新文件的一部分代码,程序走到这里的时候会报:未处理的“System.UnauthorizedAccessException”类型的异常出现在 mscorlib.dll 中。其他信息: 对路径的访问被拒绝。我用xp里的管理员帐号就可以更新,但是非管理员帐号就不行,有什么解决办法吗?在线等----------如果是权限不够 该如果设置C#的权限? 不是webform而是winform程序
            }            File.Move(filePath + ".tmp", filePath);
            //继续下载其它文件
            evtPerDonwload.Set();