i have add .zip file to my resource how can i access that zip file ?
Press the Ctrl + Alt + Del keys at the same time and select Start Task Manager on the screen that appears. In the Task Manager, click the Performance tab, then click the Resource Monitor button or Open Resource Monitor link, depending on your version of Windows.
A resource file is a text file with the extension . rc. The file can use single-byte, double-byte, or Unicode characters. The syntax and semantics for the RC preprocessor are similar to those of the Microsoft C/C++ compiler.
Add your resource to the project in the project properties...(which you did)
Then it's simple...
var zipFile = MyNamespace.Properties.Resources.My_Zip_File;
Visual Studio Community 2015 answer:
The file is now accessible programatically. The path and file is part of the assembly when debugging and when the progam is installed as a final publish. It compares favorably against using absolute path. Example C# header:
using System.IO; using System.Reflection;
Example C# code:
String strAppPath = Path.GetDirectoryName(System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName); String strFilePath = Path.Combine(strAppPath, "Resources"); String strFullFilename = Path.Combine(strFilePath, "My_Zip_File.zip");
` For example, we can read the file as Stream and we can also open the file using strFullFileName.
Source of reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With