embedded-resource

Run .exe packaged in .jar

女生的网名这么多〃 提交于 2019-12-11 04:24:01
问题 I am trying to merge 2 programs I have made to one .jar file. One program is a .jar written in java and the second one is an .exe written in c++. I put both files to the new .jar, wrote this code but it didn't work. When this code was exported to .jar and executed neither of 2 files ran and I got error "no main manifest attribute, in merged.jar" in cmd. Though it worked perfectly when run in eclipse. public class main { public static void main(String[] args) { try { Runtime.getRuntime().exec(

MonoDroid - setting background color from colors.xml throws InvalidOperationException

与世无争的帅哥 提交于 2019-12-11 03:58:26
问题 I have a simple layout as follows: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/widget30" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/translucent_red" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"> My colors.xml file is as follows: <?xml version="1.0" encoding="utf-8"?> <resources> <color name="opaque_red">#f00</color> <color name="translucent_red">#80ff0000</color> <

Assembly loaded from Resources raises Could not load file or assembly

你离开我真会死。 提交于 2019-12-11 02:54:18
问题 I am writing a simple application that should create some shortcuts. For this I use Interop.IWshRuntimeLibrary that i add as an Embedded Resource. On class init I call Assembly.Load(Resources.Interop_IWshRuntimeLibrary); I also tried: AppDomain.CurrentDomain.Load(Resources.Interop_IWshRuntimeLibrary); When I build the application in VisualStudio Output window I see that the assembly is loaded: Loaded "Interop.IWshRuntimeLibrary". But, when I try to use the objects in that assembly it gives me

Setting CSS background-image where the image is a resource or WebResource in a .NET assembly

喜你入骨 提交于 2019-12-11 02:51:46
问题 I am writing an ASP.NET server control that will live in its own assembly. It's a refactoring of something already in the app, which uses CSS background images. I don't want to require the user of the assembly to have to install a separate images folder, so -- if it's possible -- I'd like to store the images as resources in the server control's assembly. But I'd still like to use CSS to set them as background images. Unless I'm mistaken, CSS is my only option for setting background images. Is

Add Image file resource to another project

微笑、不失礼 提交于 2019-12-11 01:42:24
问题 I want to add/update Image resources in a .NET project, so that when the application is compiled the images will be available at runtime. Due to having a large amount of images in several locations I want to do this using a separate vb.net project. The only way I can see to do this is to copy the image file to the [Project]\Resources folder and then edit the [Project]\My Project\Resources.resx to use this image file, but this seems a bit hacky and I'm not sure how fussy Visual Studio is about

Cannot instantiate the type Image java?

只愿长相守 提交于 2019-12-11 00:25:11
问题 public Image images[] = new Image[20]; for(i=0; i<10; i++){ images[i]=new Image(getClass().getResource("/images/"+i+".jpg")); } I am trying to add images to array but it gives the error Cannot instantiate the type Image j What can be the reason? 回答1: Abstract classes cant be instantiated directly. You could use ImageIO.read which returns BufferedImage , a sub-class of Image void loadImages() throws IOException { for (int i = 0; i < 10; i++) { images[i] = ImageIO.read(getClass().getResource("

Embedding a filesystem in an executable?

£可爱£侵袭症+ 提交于 2019-12-10 21:28:33
问题 I'm just sort of curious: If I wanted to embed a filesystem in an executable, I assume I'd just embed an image of the filesystem using objcopy. However, what sort of filesystem should I use? Is there going to be an easy library for directly accessing the filesystem image? I don't have any use for this, so responses like "don't do it, use actual files instead" are irrelevant. 回答1: There exist so-called virtual file system implementations, which were designed with custom storage in mind. To

Add image icons to buttons/labels Swing

拟墨画扇 提交于 2019-12-10 20:25:55
问题 I know that this question has already been posted, but I've tried everything I found and nothing worked. I have a Maven project, and I want to use images on buttons. I put the images in the src/main/res folder . After a Maven clean/ Maven install, all my images are found in the target/classes folder. I want the images to be inside the .jar file, so that I don't need to create a separate folder when using it. This is the code I try to use to load the image for a new icon on my button: JButton

Is there a way to find the last modified date of an embedded resource in .NET?

冷暖自知 提交于 2019-12-10 17:24:19
问题 Does anybody know a way of doing this (at runtime)? I'm not sure I can elaborate much more in the description than is already given away in the title, but if you feel I missed something do say! 回答1: The .resx file itself should have a modified date associated with it, but you won't be able to get the modified date of individual resources within that file. 来源: https://stackoverflow.com/questions/999179/is-there-a-way-to-find-the-last-modified-date-of-an-embedded-resource-in-net

Can any third-party load embedded resources from my project?

南楼画角 提交于 2019-12-10 17:23:07
问题 Please refer to one of my previous questions. I'm asking about loading a compiled resource from a DLL. Then refer to the answer by David Heffernan. His suggestion is to use a built-in mechanism to load a resource directly from the DLL's instance, without even using my own exported function. This pointed out a security loophole to me. If this is really the case, if this type of solution is possible, then can any outside third-party load resources from any Delphi Application/DLL? How secure are