亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? downloader.cs

?? 一個飯店管理系統(tǒng)
?? CS
?? 第 1 頁 / 共 2 頁
字號:
				//Walk files
				FileInfo[] Files = Source.GetFiles();
				foreach (FileInfo pFile in Files)
				{
					//File check here
					if (!Keys.ValidateAssembly(pFile.FullName))
					{
						throw new Exception("Invalid assembly:  " + pFile.FullName); 
					}
				}

				//Recurse into subdirectories
				DirectoryInfo[] Directories = Source.GetDirectories();
				foreach (DirectoryInfo pDirectory in Directories)
				{
					ValidateDirectory(Path.Combine(source,pDirectory.Name));
				}
			} 
			catch (Exception e)
			{
				Debug.WriteLine("APPMANAGER: Failed to validate new version.");
				Debug.WriteLine("APPMANAGER:  " + e.ToString());

				UpdateEventArgs.ErrorMessage = e.Message;

				throw;
			}	
		}

		//**************************************************************
		// Scavenge()	
		//**************************************************************
		private void Scavenge()
		{
			DirectoryInfo Root = new DirectoryInfo(GetParentFolder(AppDomain.CurrentDomain.BaseDirectory));
			DirectoryInfo[] Directories = Root.GetDirectories();

			foreach (DirectoryInfo Directory in Directories)
			{
				if (((MakeValidPath(Directory.FullName)).ToLower(new CultureInfo("en-US")) 
					  != AppDomain.CurrentDomain.BaseDirectory.ToLower(new CultureInfo("en-US")))
					&& ((MakeValidPath(Directory.FullName)).ToLower(new CultureInfo("en-US"))
					  != Config.AppPath.ToLower(new CultureInfo("en-US"))) &&
					Directory.Name.ToLower(new CultureInfo("en-US")) != "bin")
				{
					try 
					{
						HardDirectoryDelete(MakeValidPath(Directory.FullName));
					} 
					catch (Exception)
					{
						//If we can't delete it, just leave it.
					}
				}
			}
		}


		//**************************************************************
		// Merge()	
		//**************************************************************
		private void MergeDirectory(string source, string destination)
		{
			try 
			{
				//Get a reference to the source directory
				DirectoryInfo Source = new DirectoryInfo(source);
			
				//Create this directory if it doesn't exist
				if (!Directory.Exists(destination)) 
				{
					Directory.CreateDirectory(destination);
					//copy the attributes
					DirectoryInfo Destination = new DirectoryInfo(destination);
					Destination.Attributes = Source.Attributes;
				}

				//Copy files
				FileInfo[] Files = Source.GetFiles();
				foreach (FileInfo pFile in Files)
				{
					if (!File.Exists(Path.Combine(destination,pFile.Name))
						&& (!isManifestFile(pFile.Name)))
						pFile.CopyTo(Path.Combine(destination,pFile.Name),true);
				}

				//Recurse into subdirectories
				DirectoryInfo[] Directories = Source.GetDirectories();
				foreach (DirectoryInfo pDirectory in Directories)
				{
					MergeDirectory(Path.Combine(source,pDirectory.Name),Path.Combine(destination,pDirectory.Name));
				}
			} 
			catch (Exception e)
			{
				Debug.WriteLine("APPMANAGER:  FAILED to copy:  " + source + " to " + destination);
				Debug.WriteLine("APPMANAGER:  " + e.ToString());

				UpdateEventArgs.ErrorMessage = "Copy of user files from the current app directory '" + source 
					   + "' to the new app directory'" + destination + "' failed with the following error:  " + e.Message;

				throw;
			}	
		}

		//**************************************************************
		// FinalizeUpdate()	
		//**************************************************************
		private void FinalizeUpdate()
		{
			//Create & reserve the properly named new version directory based on the 
			//assembly version of the downloaded version
			try 
			{
				if (AppMan.Manifest.State.NewVersionDirectory =="")
				{
					AppMan.Manifest.State.NewVersionDirectory = CreateNewVersionDirectory();
					AppMan.Manifest.Update();
				}
			} 
			catch (Exception)
			{
				UpdateEventArgs.ErrorMessage = "Failed to create the New Version Directory, using temp download directory as final destination.";
				AppMan.Manifest.State.NewVersionDirectory = AppMan.Manifest.State.DownloadDestination;
				AppMan.Manifest.Update();
			}

			//Copy the downloaded version into the new directory
			try 
			{
				if (AppMan.Manifest.State.NewVersionDirectory.ToLower(new CultureInfo("en-US")) != AppMan.Manifest.State.DownloadDestination.ToLower(new CultureInfo("en-US")))
					CopyDirectory(AppMan.Manifest.State.DownloadDestination,AppMan.Manifest.State.NewVersionDirectory);
			} 
			catch (Exception e)
			{
				UpdateEventArgs.ErrorMessage = "Failed to copy the downloaded update at: '"+AppMan.Manifest.State.DownloadDestination
					+"' to the new version directory at: '" + AppMan.Manifest.State.NewVersionDirectory + "'" ;
				throw e;
			}

			//Write the new version location into the AppConfig file.
			//This is the act that makes the update officially complete
			try 
			{
				char[] MyChar={'\\'};
				Config.AppFolderName = Path.GetFileName(AppMan.Manifest.State.NewVersionDirectory.TrimEnd(MyChar));
				Config.Udpate();
			} 
			catch (Exception e)
			{
				UpdateEventArgs.ErrorMessage = "Failed to write to 'AppStart.config'";
				throw e;
			}

			try 
			{
				if (AppMan.Manifest.State.NewVersionDirectory.ToLower(new CultureInfo("en-US")) != AppMan.Manifest.State.DownloadDestination.ToLower(new CultureInfo("en-US")))
					HardDirectoryDelete(AppMan.Manifest.State.DownloadDestination);
			} 
			catch (Exception)
			{
				//Don't fail the update just because the download copy can't be deleted.
				//It will be scavenged later.
			}

		}

		//**************************************************************
		// CreateTempDirectory()	
		//**************************************************************
		private string CreateTempDirectory()
		{
			const int DirectoryCreateRetryAttempts = 50;
			int counter = 0;
			Random Rand = new Random();
			string RandomAddition = "";

			string RootDirectory = GetParentFolder(AppDomain.CurrentDomain.BaseDirectory);
			string TempDirectory;

			do 
			{
				TempDirectory = RootDirectory + "AppUpdate" + RandomAddition + "\\";
				RandomAddition = "_"+Rand.Next(10000).ToString();
				counter++;
			} while (counter <= DirectoryCreateRetryAttempts && Directory.Exists(TempDirectory));

			if (counter >= DirectoryCreateRetryAttempts)
			{
				Debug.WriteLine("APPMANAGER:  Failed to create temporary download Directory after 1000 attempts");
				UpdateEventArgs.ErrorMessage = "Failed to created temporary download directory in: '"+RootDirectory+"'";
				throw (new Exception("Failed to create temporary download Directory after 1000 attempts"));
			}
			else
			{
				try 
				{
					Directory.CreateDirectory(TempDirectory);
				} 
				catch (Exception e)
				{
					Debug.WriteLine("APPMANAGER:  Failed to create temporary download Directory");
					Debug.WriteLine("APPMANAGER:  " + e.ToString());
					throw e;
				}
			}

			return TempDirectory;
		}

		//**************************************************************
		// CreateNewVersionDirectory()	
		//**************************************************************
		private string CreateNewVersionDirectory()
		{
			string NewExePath;
			NewExePath = AppMan.Manifest.State.DownloadDestination;
			NewExePath += Config.AppExeName;

			string NewDirectoryName;		
			NewDirectoryName = GetFileVersion(NewExePath);
 
			string NewDirectoryRoot = GetParentFolder(AppMan.Manifest.State.DownloadDestination);
			string NewDirectoryFullPath = "";

			const int DirectoryCreateRetryAttempts = 999;
			int counter = 1;
			bool FileOpSucceeded = false;
			string RandomAddition = "";

			do 
			{
				NewDirectoryFullPath = NewDirectoryRoot + NewDirectoryName + RandomAddition + "\\";
				RandomAddition = "_"+counter.ToString();
				counter++;

				try 
				{
					if (!Directory.Exists(NewDirectoryFullPath))
					{
						Directory.CreateDirectory(NewDirectoryFullPath);
						FileOpSucceeded = true;
					}
				} 
				catch (Exception)
				{
					FileOpSucceeded = false;
					Debug.WriteLine("APPMANAGER:  Failed to rename download Directory to: " + NewDirectoryFullPath);
					Debug.WriteLine("APPMANAGER:  Trying to rename again.");
				}
			
			} while (counter <= DirectoryCreateRetryAttempts && !FileOpSucceeded);

			if (counter >= DirectoryCreateRetryAttempts)
			{
				Debug.WriteLine("APPMANAGER:  Failed to rename temporary download Directory after 1000 tries");
				Debug.WriteLine("APPMANAGER:  Leaving in temporary directory");
				NewDirectoryFullPath = AppMan.Manifest.State.DownloadDestination;
			}

			return NewDirectoryFullPath;
		}

		//**************************************************************
		// MakeValidPath()	
		//**************************************************************
		private string MakeValidPath(string source)
		{
			if (source.EndsWith(@"\"))
				return source;
			else
				return (source + @"\");
		}

		//**************************************************************
		// CopyDirectory()	
		//**************************************************************
		private void CopyDirectory(string source, string destination)
		{
			try 
			{
				//Get a reference to the source directory
				DirectoryInfo Source = new DirectoryInfo(source);
			
				//Create this directory if it doesn't exist
				if (!Directory.Exists(destination)) 
				{
					Directory.CreateDirectory(destination);
					//copy the attributes
					DirectoryInfo Destination = new DirectoryInfo(destination);
					Destination.Attributes = Source.Attributes;
				}

				//Copy files
				FileInfo[] Files = Source.GetFiles();
				foreach (FileInfo pFile in Files)
				{
					if (!File.Exists(Path.Combine(destination,pFile.Name)))
						pFile.CopyTo(Path.Combine(destination,pFile.Name),true);
				}

				//Recurse into subdirectories
				DirectoryInfo[] Directories = Source.GetDirectories();
				foreach (DirectoryInfo pDirectory in Directories)
				{
					CopyDirectory(Path.Combine(source,pDirectory.Name),Path.Combine(destination,pDirectory.Name));
				}
			} 
			catch (Exception e)
			{
				Debug.WriteLine("UPDATER:  FAILED to copy:  " + source + " to " + destination);
				Debug.WriteLine("UPDATER:  " + e.ToString());
				throw e; 
			}		
		}

		//**************************************************************
		// HardDirectoryDelete()	
		//**************************************************************
		private void HardDirectoryDelete(string source)
		{
			try 
			{
				if (!Directory.Exists(source))
					return;

				//Get a reference to the source directory
				DirectoryInfo Source = new DirectoryInfo(source);
				Source.Attributes = FileAttributes.Normal;
		
				//Clear the attributes on the files
				FileInfo[] Files = Source.GetFiles();
				foreach (FileInfo pFile in Files)
				{
					pFile.Attributes = FileAttributes.Normal;
				}

				//Recurse into subdirectories
				DirectoryInfo[] Directories = Source.GetDirectories();
				foreach (DirectoryInfo pDirectory in Directories)
				{
					HardDirectoryDelete(Path.Combine(source,pDirectory.Name));
				}

				Source.Delete(true);
			} 
			catch (Exception e)
			{
				Debug.WriteLine("APPMANAGER:  FAILED to delete:  " + source);
				Debug.WriteLine("APPMANAGER:  " + e.ToString());
				throw e;
			}
		}

		//**************************************************************
		// GetFileVersion()	
		//**************************************************************
		private string GetFileVersion(string filePath)
		{
			AssemblyName AN = AssemblyName.GetAssemblyName(filePath);
			return AN.Version.ToString();
		}


		//**************************************************************
		// GetParentFolder()	
		//**************************************************************
		private string GetParentFolder(string filePath)
		{
			DirectoryInfo DI = new DirectoryInfo(filePath);
			return (DI.Parent.Parent.FullName + @"\");
		}

		//**************************************************************
		// isManifestFile()	
		//**************************************************************
		private bool isManifestFile(string name)
		{
			string ManifestName = Path.GetFileName(AppMan.Manifest.FilePath);
			if (ManifestName.ToLower(new CultureInfo("en-US")) == name.ToLower(new CultureInfo("en-US")))
				return true;
			else
				return false;
		}
	}

	//**************************************************************
	// UpdateCompleteEventArgs Class
	//**************************************************************
	public class UpdateCompleteEventArgs:EventArgs
	{
		private bool _UpdateSucceeded;
		public bool UpdateSucceeded 
		{ get { return _UpdateSucceeded; } set { _UpdateSucceeded = value; } }

		private Exception _FailureException;
		public Exception FailureException 
		{ get { return _FailureException; } set { _FailureException = value; } }

		private string _ErrorMessage;
		public string ErrorMessage 
		{ get { return _ErrorMessage; } set { _ErrorMessage = value; } }

		private Version _NewVersion;
		public Version NewVersion 
		{ get { return _NewVersion; } set { _NewVersion = value; } }
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区在线| 亚洲免费观看视频| 麻豆精品国产传媒mv男同| 色系网站成人免费| 亚洲精品久久嫩草网站秘色| 老司机午夜精品| 欧美日韩国产经典色站一区二区三区 | 91麻豆精品国产| 亚洲午夜电影在线| 久久久一区二区三区捆绑**| 蜜桃视频在线一区| 欧美xxx久久| 国产一区二区三区| 国产色爱av资源综合区| 国产成人在线观看| 国产精品免费av| 国产精品12区| 中文字幕免费不卡| 成人免费av资源| 亚洲婷婷综合色高清在线| 日本高清视频一区二区| 日韩综合小视频| 日韩欧美自拍偷拍| 国产黄人亚洲片| 首页国产欧美日韩丝袜| 国产无人区一区二区三区| 欧洲中文字幕精品| 久久成人免费日本黄色| 亚洲精品国产品国语在线app| 4438x成人网最大色成网站| 紧缚捆绑精品一区二区| 国产欧美日韩精品在线| 91亚洲永久精品| 亚洲欧美色一区| 欧美videossexotv100| eeuss影院一区二区三区| 日韩精品国产欧美| 亚洲精品日韩一| 国产三级精品在线| 日韩美女一区二区三区| 色婷婷精品大视频在线蜜桃视频| 狠狠v欧美v日韩v亚洲ⅴ| 中文字幕在线一区| 日韩精品一区国产麻豆| 91免费版在线| 国产成人在线看| 国内久久婷婷综合| 亚洲精品国产无天堂网2021| 国产亚洲一区字幕| 91福利在线导航| 国产精品亚洲午夜一区二区三区| 婷婷久久综合九色综合绿巨人| 日本视频一区二区三区| 亚洲视频一二区| 亚洲欧美视频在线观看视频| 亚洲欧美在线aaa| 中文字幕欧美国产| 亚洲国产精品传媒在线观看| 国产精品美女久久久久aⅴ国产馆| 久久久精品免费免费| 久久精品亚洲精品国产欧美kt∨| 国产亚洲欧美日韩在线一区| 中文字幕乱码亚洲精品一区 | 91福利视频久久久久| 91美女在线观看| 88在线观看91蜜桃国自产| 欧美一区二区观看视频| 欧美人动与zoxxxx乱| 欧美二区乱c少妇| 欧美一区二区久久| 日韩欧美中文字幕精品| 欧美亚洲图片小说| 91精品国产高清一区二区三区| 欧美性大战xxxxx久久久| 在线欧美日韩精品| 日韩一区二区麻豆国产| 久久精品视频免费观看| 亚洲精品一二三区| 奇米777欧美一区二区| 成人国产一区二区三区精品| 欧美亚洲国产怡红院影院| 欧美成人女星排名| 亚洲色图欧洲色图| 亚洲高清视频在线| 麻豆成人免费电影| 国产成人午夜精品5599| 成人ar影院免费观看视频| 972aa.com艺术欧美| 欧美电影免费观看高清完整版在| 国产精品久久久久久久久久久免费看| 午夜不卡av在线| 99久久精品情趣| 久久久久九九视频| 久久精品国产99国产精品| 欧美三级韩国三级日本一级| 中文字幕一区二区在线播放| 激情综合色综合久久| 欧美视频第二页| 自拍偷自拍亚洲精品播放| 国产一区二区三区高清播放| 91精品国产色综合久久不卡电影| 91精品国产一区二区人妖| 亚洲日本青草视频在线怡红院| 国产在线看一区| 91精品国产欧美一区二区成人| 亚洲精品美腿丝袜| 色综合天天综合在线视频| 亚洲乱码国产乱码精品精98午夜| 成人福利视频在线| 中文无字幕一区二区三区| 国产成人小视频| 日韩欧美一区二区不卡| 青青草成人在线观看| 91精品国产入口在线| 美女在线视频一区| 欧美一级久久久久久久大片| 日本一不卡视频| 久久久久久久久久久久久夜| 成人综合在线观看| 亚洲日本乱码在线观看| 欧美乱妇一区二区三区不卡视频| 性做久久久久久免费观看| 欧美一级久久久久久久大片| 成人a免费在线看| 麻豆一区二区三区| 亚洲美女屁股眼交3| 日本一区二区三区电影| 欧美视频一二三区| 韩国三级在线一区| 亚洲女人****多毛耸耸8| 日韩免费高清av| 色88888久久久久久影院野外| 日日夜夜精品免费视频| 日本一区二区三区四区在线视频| 欧美日韩免费高清一区色橹橹| 国产剧情一区二区| 天天综合天天做天天综合| 久久男人中文字幕资源站| 日本韩国欧美一区二区三区| 精品一区二区免费在线观看| 亚洲乱码中文字幕综合| 国产亚洲短视频| 欧美精品在线一区二区三区| 成人自拍视频在线观看| 国产在线不卡一区| 亚洲精品成人天堂一二三| 中文字幕第一区综合| 久久久久久久综合狠狠综合| 欧美精品自拍偷拍| 欧美性大战xxxxx久久久| 91美女蜜桃在线| av在线播放成人| 不卡电影免费在线播放一区| 成人国产在线观看| 国产中文字幕一区| 激情图片小说一区| 日韩主播视频在线| 青青国产91久久久久久| 亚洲综合图片区| 亚洲精品美国一| 亚洲成人精品一区| 五月婷婷久久丁香| 午夜视黄欧洲亚洲| 五月婷婷久久综合| 久久99日本精品| 不卡av免费在线观看| a4yy欧美一区二区三区| 欧美在线看片a免费观看| 91黄视频在线观看| 欧美tickling网站挠脚心| 国产精品日日摸夜夜摸av| 亚洲男人的天堂在线观看| 日日夜夜免费精品视频| 国内精品自线一区二区三区视频| www.性欧美| 欧美一区二区不卡视频| 久久日一线二线三线suv| 国产精品不卡一区二区三区| 亚洲1区2区3区视频| 国产高清在线精品| 在线观看成人小视频| 欧美xfplay| 青娱乐精品视频| 色婷婷综合久久久中文一区二区| 日韩亚洲欧美在线| 伊人夜夜躁av伊人久久| 精品午夜一区二区三区在线观看| 欧美吻胸吃奶大尺度电影| 1000部国产精品成人观看| 精品一区二区三区香蕉蜜桃| 欧美日韩成人一区| 亚洲高清在线视频| 91久久精品一区二区三区| **欧美大码日韩| 成人av在线资源网| 精品日韩av一区二区| 日本视频免费一区| 91精品国产一区二区三区蜜臀| 亚洲欧美日韩综合aⅴ视频| 成人动漫精品一区二区|