Solved

How to add file in resource and show in form?

Posted on 2011-03-14
11
230 Views
Last Modified: 2012-05-11
Hi guys

i want need a form with filedialog for select a file and save to resource

then  show my file in form2

help me plz
0
Comment
Question by:l0o3
  • 4
  • 4
  • 2
  • +1
11 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35127988
Can you explain more about what you're trying to do here?

What do you mean by "save to resource"?
0
 
LVL 3

Expert Comment

by:1303gun
ID: 35128380
Hello.

Well, if your intention is to load a file into the application's embedded resource, I'm afraid that this is not possible.

I think that the only way you could do something similar is to use reflection to recompile the current assembly with different resources, but this would create another executable.

If that's of you interest, I can do some research and post here.

But why exactly do you want to load the file into resource? You could create an XML file and insert the file into it as a base 64 string.
0
 

Author Comment

by:l0o3
ID: 35128530
hi Idle_Mind, resource file in vb.net : My project> Resources

hi 1303gun, my files is flash (swf) and image (gif) , can u give me sample with  xml?


tnx
0
 
LVL 3

Expert Comment

by:1303gun
ID: 35128610
Yes. I'll pepare a sample code and then send you.
0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35128902
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:l0o3
ID: 35128942
1303gun i am wait. tnx
0
 

Author Comment

by:l0o3
ID: 35128959
Medo3337 i want add file using file dialog in resource
0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 35129016
0
 
LVL 3

Accepted Solution

by:
1303gun earned 500 total points
ID: 35130195
Hello.

Attached is a sample project demonstrating how to store resources in an external XML file.

It's very simple to do it, so I think you won't have problems in understanding it. However if you have any doubts just ask.

The application is programmed only to display SWF and some image formats (including GIF).

Before using, you may have to set the new path for the Shockwave Flash reference in the project settings (My Project > References). If you don't know where these files are located, delete the two Shockwave Flash references and click "Add...". On the reference selection form, go to the COM tab and find Shockwave Flash in the list. Select it and click OK. This should do it.

The project was made in Visual Studio 2010.
XMLResource.zip
0
 

Author Closing Comment

by:l0o3
ID: 35130266
Thank you
0
 
LVL 3

Expert Comment

by:1303gun
ID: 35130419
You're welcome.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now