The Joker
The Joker
CC#
Created by The Joker on 5/5/2023 in #help
❔ C# Help Doubt Resource1.resx
3 replies
CC#
Created by The Joker on 3/5/2023 in #help
✅ System.NullReferenceException: 'Object reference not set to an instance of an object.' C#
13 replies
CC#
Created by The Joker on 3/2/2023 in #help
❔ Help to close a forms from another forms C#
I created 2 scripts with a timer with intervals of 1000 ms, both one is to open a new form when a certain process is started, this side is working fine, and the other is to close the same forms when the given process is closed, I've tried several times forms and I can't close the forms that were opened when the process is finished, could someone help me?
private void timer2_Tick(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("teste");

if (processes.Length == 1)
{
frmTimer tm = new frmTimer();
tm.Show();

timer2.Stop();
}
}

///


private void timer1_Tick(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("teste");

if (processes.Length == 0)
{
frmTimer tm = new frmTimer();
tm.Close();

timer1.Stop();
}
}
private void timer2_Tick(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("teste");

if (processes.Length == 1)
{
frmTimer tm = new frmTimer();
tm.Show();

timer2.Stop();
}
}

///


private void timer1_Tick(object sender, EventArgs e)
{
Process[] processes = Process.GetProcessesByName("teste");

if (processes.Length == 0)
{
frmTimer tm = new frmTimer();
tm.Close();

timer1.Stop();
}
}
12 replies
CC#
Created by The Joker on 2/28/2023 in #help
❔ Help C# countdown timer
53 replies
CC#
Created by The Joker on 2/23/2023 in #help
❔ Help with StreamReader txt file
hello everybody! I'm trying to do a reading inside a .txt file, at first I type a name in a textbox when I give the command that name would be searched inside the .txt file and if it found the name it will be deleted, does anyone have any idea how do that?
private void btnDelete_Click(object sender, EventArgs e)
{
string path = @"ADDONS\Favorites.txt";
StreamReader fav = new StreamReader(path);

string[] lines = File.ReadAllLines(fav.ToString());

foreach (string line in lines)
{
if(line.ToString() == textbox1.Text.ToString())
{
line.Replace(line, "");
}
}
fav.Close();
}
private void btnDelete_Click(object sender, EventArgs e)
{
string path = @"ADDONS\Favorites.txt";
StreamReader fav = new StreamReader(path);

string[] lines = File.ReadAllLines(fav.ToString());

foreach (string line in lines)
{
if(line.ToString() == textbox1.Text.ToString())
{
line.Replace(line, "");
}
}
fav.Close();
}
4 replies
CC#
Created by The Joker on 2/22/2023 in #help
❔ Process.Start() Retroarch Emulator C#
37 replies