4
How to use items
SortedDictionary
File.WriteAllBytes
to start or complete a file and folder installation process for the computer.
Ex:
File list:
void AlocarArquivos(){
var arquivo_e_pasta = new SortedDictionary<string, byte[]>();
arquivo_e_pasta.Add(@"\bin32\dedicated.exe", Properties.Resources.bin32_dedicated);
arquivos_e_pastas.Add(@"\sdk\player.df", Properties.Resources.PLAYER_DF_BTS);
}
And then go from one to one applying it:
var enum0 = arquivos_e_pastas.GetEnumerator();
while(enum0.MoveNext()){
File.WriteAllBytes(enum0.Current.Key, enum0.Current.Value);
}
But only having the installation progress applying Thread.Sleep
without crashing the application.
I doubt I need one
SortedDictionary
for this. You should give preference to theforeach
. The problem with the question is that it’s too loose. It doesn’t have a context.– Maniero
Nathan, please prefer it format your posts in Markdown. Use
<pre><code>
, the code does not render the language markup.– brasofilo