using
System;
using
System.Collections.Generic;
using
Microsoft.Xna.Framework;
using
Microsoft.Xna.Framework.Audio;
using
Microsoft.Xna.Framework.Content;
using
Microsoft.Xna.Framework.GamerServices;
using
Microsoft.Xna.Framework.Graphics;
using
Microsoft.Xna.Framework.Input;
using
Microsoft.Xna.Framework.Net;
using
Microsoft.Xna.Framework.Storage;
public
class Game
: Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
public Game()
{
graphics =
new
GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override
void LoadContent()
{
//**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**
//**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**
// Our Content is ready to be used here so we'll
print out all the files
// that are with our file
System.IO.DirectoryInfo
dr = new System.IO.DirectoryInfo(StorageContainer.TitleLocation);
if (dr.Exists)
{
foreach (System.IO.DirectoryInfo
dir in dr.GetDirectories())
{
System.Diagnostics.Debug.WriteLine("["
+ dir + "]");
foreach (System.IO.FileInfo
fl in dir.GetFiles("*.*"))
{
System.Diagnostics.Debug.WriteLine(fl);
}
}
}
// Just for that extra check, we'll actually read
our txt file in
// and write its contents out to the debug output
window
System.IO.StreamReader
data = new System.IO.StreamReader(StorageContainer.TitleLocation
+ "\\Content\\" +
"myfiletoload.txt");
string str = data.ReadLine();
System.Diagnostics.Debug.WriteLine(str);
//**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**
//**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**FILE**
}
protected override
void Update(GameTime
gameTime)
{
// Allows the game to exit
if (GamePad.GetState(PlayerIndex.One).Buttons.Back
== ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}
protected override
void Draw(GameTime
gameTime)
{
graphics.GraphicsDevice.Clear(Color.BurlyWood);
base.Draw(gameTime);
}
}
//
Program Entry Point
static
class Program
{
static void
Main(string[] args)
{
using (Game
game = new Game())
{
game.Run();
}
}
} |