I've started developing of card game with XNA but I had problems reading all the cards inside the Cards directory which is inside a Content.
I've tried following code:
string[] nomeCartas = Directory.GetFiles(@"Cards");
But with that I retrieved an error saying it could not be possible to find part of the path:
Não foi possível encontrar uma parte do caminho 'C:\Users\Serafim\Documents\Visual Studio 2010\Projects\JogoSuecaOnline\JogoSuecaOnline\JogoSuecaOnline\bin\x86\Debug\Cards\'.
I checked that path and it's wrong, the correct path should be:
C:\Users\Serafim\Documents\Visual Studio 2010\Projects\JogoSuecaOnline\JogoSuecaOnline\JogoSuecaOnline\bin\x86\Debug\Content\Cards\
Is there any other way to read the Directory Content with XNA or how can I fix this?
string[] nomeCartas = Directory.GetFiles( Content.RootDirectory + "\\Cards" );
Try:
Directory.GetFiles(@"Content\Cards");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With