ChinhDo.Transactions.TxFileManager.WriteAllBytes C# (CSharp) Method

WriteAllBytes() public method

Creates a file, and writes the specified contents to the file. If the file already exists, it is overwritten.
public WriteAllBytes ( string path, byte contents ) : void
path string The file to write to.
contents byte The bytes to write to the file.
return void
		public void WriteAllBytes(string path, byte[] contents)
		{
			GetEnlistment().WriteAllBytes(path, contents);
		}

Usage Example

コード例 #1
0
		/// <summary>
		/// Get the ReadMe file path if it exists.
		/// </summary>
		/// <param name="p_strFileName">The mod file name.</param>
		/// <param name="p_intReadmeFile">The index of the readme file to get.</param>
		public string GetModReadMe(string p_strModName, string p_strFileName)
		{
			string strReadMe = String.Empty;
			if (m_dicReadMeFiles.ContainsKey(p_strModName))
			{
				string strModReadMeFile = p_strModName + ".7z";
				strModReadMeFile = Path.Combine(m_strReadMePath, strModReadMeFile);
				if (File.Exists(strModReadMeFile))
				{
					PurgeTempFolder();
					Archive arcFile = new Archive(strModReadMeFile);
					byte[] bteData = arcFile.GetFileContents(p_strFileName);
					if ((bteData != null) && (bteData.Length > 0))
					{
						TxFileManager tfmFileManager = new TxFileManager();
						string strReadMeFile = Path.Combine(ReadMeTempPath, p_strFileName);
						tfmFileManager.WriteAllBytes(strReadMeFile, bteData);
						return strReadMeFile;
					}
				}
			}

			return strReadMe;
		}
All Usage Examples Of ChinhDo.Transactions.TxFileManager::WriteAllBytes