embedded-resource

How do I check if an embedded resource exists or not?

。_饼干妹妹 提交于 2019-12-10 02:45:01
问题 In Delphi, I'm building an HTTP Application, or a Web Server rather. It's essentially an entire website built into a single EXE file. The files I'm embedding include HTML, JS, CSS, SWF, PNG, XML, etc. The resource names are the same as the original filename, with the . replaced with an _ . In the end, there will be somewhere around 40-60 files embedded inside the EXE. The problem is I don't want to write code wrapping each and every individual file. Right now, I am declaring a constant for

Cant load embedded resource with GetManifestResourceStream()

天涯浪子 提交于 2019-12-10 00:49:55
问题 I am embedding a binary file with the /linkres: compiler argument, but when i try to load it with: System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly(); string[] names = myAssembly.GetManifestResourceNames(); // it is really there by its name "shader.tkb" Stream myStream = myAssembly.GetManifestResourceStream( names[0] ); this leads to a Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'shader.tkb' or one of its

MonoTouch: using embedded resx files on iPhone build

萝らか妹 提交于 2019-12-09 06:10:28
I'm able to load and access resx files in Simulator builds of my iPhone app built using MonoTouch. The resx file entry in the csproj file looks like: <ItemGroup> <EmbeddedResource Include="MapMenu\Resources\MapMenu.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>MapMenu.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> The .resx file itself has an entry like this: <data name="Main_Menu" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Main Menu.mm;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows

Should I embed CSS/JavaScript files in a web application?

流过昼夜 提交于 2019-12-08 20:13:39
问题 I've recently started embedding JavaScript and CSS files into our common library DLLs to make deployment and versioning a lot simpler. I was just wondering if there is any reason one might want to do the same thing with a web application, or if it's always best to just leave them as regular files in the web application, and only use embedded resources for shared components? Would there be any advantage to embedding them? 回答1: Of course if anyone who knew what they were doing could use the

WPF: Accessing an embedded resource in XAML [duplicate]

心已入冬 提交于 2019-12-08 17:12:29
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: WPF image resources I have some images in my VS C# project that are declared as embedded resources. I'm accessing them in the .cs file using: Stream logoStream = GetType().Assembly.GetManifestResourceStream("ProjNS.Image.logo.png"); Bitmap logo = new Bitmap(logoStream); But how can I access my logo in the .xaml file? 回答1: Call the Resource like this; <Image Source="Resources/ProjNS.Image.logo.png" height="100"

MonoTouch: using embedded resx files on iPhone build

寵の児 提交于 2019-12-08 04:04:01
问题 I'm able to load and access resx files in Simulator builds of my iPhone app built using MonoTouch. The resx file entry in the csproj file looks like: <ItemGroup> <EmbeddedResource Include="MapMenu\Resources\MapMenu.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>MapMenu.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> The .resx file itself has an entry like this: <data name="Main_Menu" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>Main Menu

C#: Loading an embeded swf into an flash activex without a temporary file

泄露秘密 提交于 2019-12-07 19:01:15
问题 My project requires that my final application be completely self contained in a single exe. I am already combining the executable and dlls using ILMerge (assmebly merge utility). I am hosting an flash active x control in a C# application and I have embedded the one swf i need to load into the flash control into the c# application as an embeded resource. This question shows how to write the resource to a temporary file, but it is undesirable to create temporary files for my situation. This

Importing png Files in Visual studio C++ Resource Editor

旧街凉风 提交于 2019-12-07 13:13:15
问题 I would like to be able to import png file inside of Visual Studio Resource Editor so as to be able to use the embedded resource in different other projects . Is there a solution for that? I know that it works for bitmaps but i am interested in the pngs because of the "transparency" that is availble even on lower format [16x16] or [32x32] (but lacks for bitmaps). Any ideas? Thank you. 回答1: With VS 2008 you can import pngs and they will be recognized as an image, ie you will able to "see" it,

Make resources inaccessible for user

拥有回忆 提交于 2019-12-07 12:55:11
问题 I've written a game in C/C++ which is soon ready to be released. My question is: what would be a good way to make the resources (images/sound etc) inaccessible to the user? It doesn't have to be a strong encryption, I just don't want the average player to browse the resource folders. As of now the resources are not linked in the Visual Studio project, they are loaded from a path. 回答1: A simple way to handle it would be to compress all the files into a password protected ZIP file that you

Generating Resx files for MVC

吃可爱长大的小学妹 提交于 2019-12-07 08:49:20
问题 We use resx files for globalization, along with database lookups for things that can be configured (such as tab names, which can be different by product) by our CS staff, and thus aren't known at design-time. I created a custom tool that reads resx files and intelligently dumps the key/value pairs into a relational database (matching values so we don't have duplicates). This has been a big help to our business - we don't have to send each resx for translation (and pay for duplicate