Click here to Skip to main content
16,006,440 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Estys7-Apr-10 1:25
Estys7-Apr-10 1:25 
GeneralRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Ger Hayden7-Apr-10 23:24
Ger Hayden7-Apr-10 23:24 
QuestionSave Listview by Groups Pin
CeremBeyazit5-Apr-10 7:18
CeremBeyazit5-Apr-10 7:18 
QuestionGDI+ Architect Alternative? Pin
Som Shekhar3-Apr-10 8:36
Som Shekhar3-Apr-10 8:36 
Questionhow to programmatically get a list of resource file names in solution explorer [modified] Pin
fjparisIII2-Apr-10 23:46
fjparisIII2-Apr-10 23:46 
AnswerRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 10:21
Alan N3-Apr-10 10:21 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 10:46
fjparisIII3-Apr-10 10:46 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 13:32
Alan N3-Apr-10 13:32 
Hi again,
Yes setting the build action to embedded resource does make a difference.

With the source file structure of
Resources (directory)
  hidden  (directory)
    file1.txt
    file2.txt
    TfDll.dll
  file3.txt
  file4.txt


The following code
C#
private void ShowResources2() {
  Assembly a = Assembly.GetEntryAssembly();
  foreach (String s in a.GetManifestResourceNames()) {
    Console.WriteLine("NAME {0}", s);
    if (s.Contains("TfDll.dll")) {
      using (Stream rs = a.GetManifestResourceStream(s)) {
        using (FileStream fs = File.Create("TfDll2.dll")) {
          Byte[] buff = new Byte[8192];
          Int32 read;
          while ((read = rs.Read(buff, 0, buff.Length)) > 0) {
            fs.Write(buff, 0, read);
          }
        }
      }
    }
  }
}

outputs
NAME TfSync.MainForm.resources
NAME TfSync.Properties.Resources.resources
NAME TfSync.Resources.file3.txt
NAME TfSync.Resources.file4.txt
NAME TfSync.Resources.hidden.file1.txt
NAME TfSync.Resources.hidden.file2.txt
NAME TfSync.Resources.hidden.TfDll.dll

where TfSync and MainForm are the project's namespace and form. I also recreate an identical copy of TfDll.dll as TfDll2.dll.

Alan.
GeneralYour code works (SOLVED) Pin
fjparisIII4-Apr-10 14:36
fjparisIII4-Apr-10 14:36 
AnswerRe: how to programmatically get a list of resource file names in solution explorer Pin
Luc Pattyn3-Apr-10 10:35
sitebuilderLuc Pattyn3-Apr-10 10:35 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 10:56
fjparisIII3-Apr-10 10:56 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
Luc Pattyn3-Apr-10 11:06
sitebuilderLuc Pattyn3-Apr-10 11:06 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 11:45
fjparisIII3-Apr-10 11:45 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
Luc Pattyn3-Apr-10 12:08
sitebuilderLuc Pattyn3-Apr-10 12:08 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 12:55
fjparisIII3-Apr-10 12:55 
QuestionError: Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. Pin
Nafiseh Salmani2-Apr-10 22:51
Nafiseh Salmani2-Apr-10 22:51 
AnswerRe: Error: Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized. Pin
Luc Pattyn3-Apr-10 11:30
sitebuilderLuc Pattyn3-Apr-10 11:30 
Questionstrange error "could not load devenv.exe or some of its dependencies" ( Unit testing /unit testing framework/NServiceBus.Testing.Test ) Pin
Tiju John2-Apr-10 3:30
Tiju John2-Apr-10 3:30 
AnswerRe: strange error "could not load devenv.exe or some of its dependencies" ( Unit testing /unit testing framework/NServiceBus.Testing.Test ) Pin
Luc Pattyn2-Apr-10 4:02
sitebuilderLuc Pattyn2-Apr-10 4:02 
AnswerRe: strange error "could not load devenv.exe or some of its dependencies" ( Unit testing /unit testing framework/NServiceBus.Testing.Test ) Pin
Tiju John6-Apr-10 21:04
Tiju John6-Apr-10 21:04 
Questionwho handles error while writing the source code???. Pin
Isaac Gordon1-Apr-10 20:50
Isaac Gordon1-Apr-10 20:50 
AnswerRe: who handles error while writing the source code???. Pin
pdnet1-Apr-10 21:53
pdnet1-Apr-10 21:53 
AnswerRe: who handles error while writing the source code???. Pin
Not Active2-Apr-10 2:02
mentorNot Active2-Apr-10 2:02 
QuestionDoes capFileSaveDIB work Pin
jacket601-Apr-10 9:12
jacket601-Apr-10 9:12 
QuestionHow to get the number displayed in the text which is changing randomly Pin
jaimo1-Apr-10 1:14
jaimo1-Apr-10 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.