Hi Ignacio Machin,
The reason why I put the resource in the folder because it will be cleanner.
I have images in one folder, xml files in another folder, and picture in
other folder. Now, you know why I have to put my xml file in a folder. it
works if I don't put my xml file in folder and the code look like this:
// Get the data from XML file and input into the stream
System.IO.Stream _stream = _Assembly.GetManifestResourceStream(
"Test.Configuration.xml" );
// Create read stream object so we can read data out from the stream
StreamReader _streamReader = new StreamReader( _stream );
// Make file name in current working environment
string strFilename = AppDomain.CurrentDomain.BaseDirectory +
"Configuration.xml";
// Create a file to write data from the stream to the file
StreamWriter _streamWriter = new StreamWriter( strFilename );
// Read all the data from stream and write to the file
_streamWriter.Write( _streamReader.ReadToEnd() );
// Close when finish
_streamReader.Close();
_streamWriter.Close();
// Create temporary process
System.Diagnostics.Process _Process = new System.Diagnostics.Process();
// Open the notepad file, read data from XML file and then paste data into
the notepad
System.Diagnostics.ProcessStartInfo _pcInfo = new
System.Diagnostics.ProcessStartInfo( "Notepad.exe", strFilename );
_pcInfo.UseShellExecute = false;
_pcInfo.RedirectStandardOutput = true;
_Process.StartInfo = _pcInfo;
// Start Nodepad
_Process.Start();
// Pause right here until the notepad is close
_Process.WaitForExit();
// Release the temporary process
_Process.Close();
// Create new fileinfo object
FileInfo _finfos = new FileInfo( strFilename );
// Delete file
_finfos.Delete();
Thanks you so much for your help, Ignacio. I am greatly appreciated. Take
care and have a nice day...