|
||||||
| C# Programming C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello.
I have this wierd problem when im writing to a text file with data from a array I have this method: Code:
private void writeData()
{
// Open file
StreamWriter writeData = new StreamWriter(saveMonsterSetBase.FileName, false);
// Write all data from array to file
for (int x = 0; x < MonsterSetBaseDataArray.Count; x++)
{
writeData.WriteLine(MonsterSetBaseDataArray[x]);
}
// Close stream
writeData.Close();
}
Code:
saveMonsterSetBase.ShowDialog();
if (saveMonsterSetBase.FileName != "")
{
writeData();
}
But after I save it I get a "file not found" on some other method I use This is some of the method: Code:
// Opening txt file with location from XML StreamReader findMonsterStream = new StreamReader(@XMLmonsterLocation); It looks like the writedata changes the local path because it says File not found in the path where I saved the file Example: The application and monster.txt (XMLmonsterLocation) is saved in D:\ I then use the saveFileDialog (I save a file to for example C:\) and when I access my method where I use the XMLmonsterLocation it says file not found in C:\ So I dont know why Hope you understand The StreamReader reads from a xml file that looks like this: Code:
<?xml version='1.0'?> <config> <monsterLocation>monster.txt</monsterLocation> <monsterSetBaseLocation>MonsterSetBase.txt</monsterSetBaseLocation> <monsterImageLocation>mobs\</monsterImageLocation> <mapImageLocation>maps\</mapImageLocation> <mapInfoLocation>maps\maps.txt</mapInfoLocation> </config> |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Peculiar UI Problem Needs Tackling | adriyel | C# Programming | 2 | 04-06-2008 07:46 AM |
| MFC FTP Wininet API read problem | mukul | C and C++ | 0 | 02-29-2008 02:12 AM |
| How to tackle a programming problem? | TcM | General Programming | 10 | 01-07-2008 11:29 AM |
| [C] Comparison problem | Alhazred | C and C++ | 1 | 08-29-2007 04:58 AM |
| Xav | ........ | 1333.07 |
| MeTh0Dz|Reb0rn | ........ | 1059.52 |
| John | ........ | 887.37 |
| morefood2001 | ........ | 879.43 |
| marwex89 | ........ | 869.98 |
| WingedPanther | ........ | 851.68 |
| Brandon W | ........ | 764.23 |
| chili5 | ........ | 312.39 |
| Steve.L | ........ | 254.16 |
| dcs | ........ | 225.25 |
Goal: 100,000 Posts
Complete: 82%