C
C#2y ago
Jana ♡

✅ HELP GUUYS PLEASE

help me fix c# code
28 Replies
Jana ♡
Jana ♡2y ago
Code :
string ThemeName = File.ReadAllText(@"C:/TrexLauncher Minecraft Bedrock/Launcher/Theme/Theme/Theme.TL");
if (File.Exists(ThemeName))
{
label2.Text = ThemeName;
}
else
{

}
string ThemeName = File.ReadAllText(@"C:/TrexLauncher Minecraft Bedrock/Launcher/Theme/Theme/Theme.TL");
if (File.Exists(ThemeName))
{
label2.Text = ThemeName;
}
else
{

}
The label must change to theme name but its not changing ! please help :<<
SG97
SG972y ago
you're reading the contents of the file, but checking with File.Exists for the content so when entering the if clause, what is the value of ThemeName
Jana ♡
Jana ♡2y ago
The File is exist
SG97
SG972y ago
ThemeName what is the value
Jana ♡
Jana ♡2y ago
u mean the line in txt ?
SG97
SG972y ago
on if (File.Exists(ThemeName)) no put a breakpoint (f9 on visual studio) on that if line, and check the value of ThemeName
Jana ♡
Jana ♡2y ago
file loc : @"C:/TrexLauncher Minecraft Bedrock/Launcher/Theme/Theme/Theme.TL" File txt : Theme : Pac-Man okay
SG97
SG972y ago
ok so file content is: Theme : Pac-Man?
Jana ♡
Jana ♡2y ago
yes
SG97
SG972y ago
and you use File.Exists for what?
Jana ♡
Jana ♡2y ago
if the file exist label change
SG97
SG972y ago
there is no file called Theme : Pac-Man
Jana ♡
Jana ♡2y ago
if no so label dont change i meant the line in the file Theme.TL
SG97
SG972y ago
sure, but you are reading it into ThemeName and then checking if such a file exists File.Exists
Jana ♡
Jana ♡2y ago
like how ?
SG97
SG972y ago
? just debug the code until you hit the if clause, and observe the value of ThemeName and use a breakpoint
Jana ♡
Jana ♡2y ago
mhm wait didnt work 😦
ffmpeg -i me -f null -
you're still here with this how on earth do you have that wrong path in your code ah no ok now seem better but still, why / instead of \ string ThemeName = File.ReadAllText(@"C:\TrexLauncher Minecraft Bedrock\Launcher\Theme\Theme\Theme.TL");
Jana ♡
Jana ♡2y ago
idk whats happening it wont work but no error wtf is this on earth ??
FusedQyou
FusedQyou2y ago
Stop messaging stuff like "didn't work" or "why isn't this working??" expecting us to spoonfeed you with the lack of information that we have. You clearly have no idea what you're doing, so giving you an answer is only going to make you return in 5 minutes when you encounter the next thing. Give us some actual information by telling us what the issue is, and what any possible errors tell you. And maybe (maybe!) try to understand what the code is doing at all.
Jana ♡
Jana ♡2y ago
Jana ♡
Jana ♡2y ago
look guys the label with the text Theme : Defult It Must Be Theme : PlayStation 3
FusedQyou
FusedQyou2y ago
Again, there is nothing to work with here. No code, error, anything.
FusedQyou
FusedQyou2y ago
Jana ♡
Jana ♡2y ago
MAN PLEASE I HAVE TO POST THAT ANY ERR ON MY LAUNCHER WILL CAUSES MONEY LOSE :_:
Anton
Anton2y ago
@Jana ♡ what does the line with File.ReadAllText do? convey your interpretation of it
Jana ♡
Jana ♡2y ago
i fix it i just removed the if statment
FusedQyou
FusedQyou2y ago
I love it This guy is completely oblivious to what he's doing Just for the record, your if statement did not check if the file existed on the path, it checked if it existed using the contents inside the actual file Not to mention the whole if statement is useless anyway