Christian Dale
Christian Dale
CC#
Created by Christian Dale on 5/2/2024 in #help
✅ How can I Clean my code/Make it more readable?
3 replies
CC#
Created by Christian Dale on 4/22/2024 in #help
✅ Regex Result into CSV and Data Grid
I have a Regex that outputs results as Shown in Links https://regex101.com/r/EmbhHq/3 https://regex101.com/r/vYEy0x/1 I am looking to Export the Information into a CSV and Also to be able to display the results into a a Form Table (Probably a DataGridView)
3 replies
CC#
Created by Christian Dale on 3/23/2024 in #help
✅ Looking for a way to Extract information from a txt File
Looking to Extracting Particular Information form the Log File. The Information I would like to extract is look for a Particular IP and read the Number of Alarms and then store the X & Y Co-Ords for that number of Alarms. e.g. Looking for IP 10.247.247.11 It would return
IP:10.247.247.11
Time: 2024-02-18 07:51:04
Alarm: 1
X: 845
Y:596
Size: 335
Time: 2024-02-18 07:51:04
Alarm 2
X:845
Y:596
Size:335
X:852
Y:548
Size: 100
IP:10.247.247.11
Time: 2024-02-18 07:51:04
Alarm: 1
X: 845
Y:596
Size: 335
Time: 2024-02-18 07:51:04
Alarm 2
X:845
Y:596
Size:335
X:852
Y:548
Size: 100
I will be using the XY Co-ords to draw onto an image.
11 replies
CC#
Created by Christian Dale on 1/30/2024 in #help
Extracting JSON Element into a ComboBox Data source
I have a Json file that i what to Extract one element of it into a Data Source for a Combo Box The Element I can to extract is the ModelNumber I am using NewtonSoft.Json Package for the JSON Serialize
9 replies
CC#
Created by Christian Dale on 1/22/2024 in #help
Using Instances in Multiple Locations
Within a Form I am creating an Instance of
c#
public Form()
{
EdgeDriver Driver = new(options)
{
// Url = login_url
Url = $"http://{NVR.IP}/doc/index.html#/portal/login"
};
}
c#
public Form()
{
EdgeDriver Driver = new(options)
{
// Url = login_url
Url = $"http://{NVR.IP}/doc/index.html#/portal/login"
};
}
Then within the Form there is a Button that on Click i would like to
c#
public void Close_FS_Click(object sender, EventArgs e)
{
Driver.Close();
Driver.Quit();
}
c#
public void Close_FS_Click(object sender, EventArgs e)
{
Driver.Close();
Driver.Quit();
}
How can i do this?
15 replies
CC#
Created by Christian Dale on 1/19/2024 in #help
Using same Implimentations within 2 Locations
How can I use the Same implementation in 2 Locations I have Implemented EdgeDriver within the Form But I would like to Close the Driver within the Button Click. I would also like to Control and Close the Loading of Edge within the Close Button. https://pastebin.com/RnMtv6rd
4 replies
CC#
Created by Christian Dale on 12/30/2023 in #help
Conditional User input Form
I am trying to make a Form (Form 3) that if the User clicks ok then it continues the previous code from (Form 1) Form 1 Entry Point
switch (comboBox_Type.SelectedIndex)
{
case 0: //Main Hub
GlobalClass.IP = "10.247.247.130";
NetworkSet();
break;
case 1: //Extension Hub
GlobalClass.IP = "10.247.247.150";
NetworkSet();
break;
case 2: //ALARM Module
GlobalClass.IP = "10.247.247.170";
NetworkSet();
break;
case 3: //NVR Module
GlobalClass.IP = "10.247.247.180";
NetworkSet();
break;
case 4: //Custom
GlobalClass.IP = "";
Form3 thirdForm = new Form3();
thirdForm.ShowDialog();
NetworkSet();
break;
default:
break;
}
switch (comboBox_Type.SelectedIndex)
{
case 0: //Main Hub
GlobalClass.IP = "10.247.247.130";
NetworkSet();
break;
case 1: //Extension Hub
GlobalClass.IP = "10.247.247.150";
NetworkSet();
break;
case 2: //ALARM Module
GlobalClass.IP = "10.247.247.170";
NetworkSet();
break;
case 3: //NVR Module
GlobalClass.IP = "10.247.247.180";
NetworkSet();
break;
case 4: //Custom
GlobalClass.IP = "";
Form3 thirdForm = new Form3();
thirdForm.ShowDialog();
NetworkSet();
break;
default:
break;
}
Form 3 Exit Point
public void BtnOk_Click(object sender, EventArgs e)
{
string Errors = null;
//&& IsAddressValid(NewSM.Text) == true && IsAddressValid(NewGW.Text) == true
if (IsAddressValid(NewIP.Text) != true)
{
Errors += "INVALID IP ADDRESS\n";
}
if (IsAddressValid(NewSM.Text) != true)
{
Errors += "INVALID SUBMASK ADDRESS\n";
}
if (IsAddressValid(NewGW.Text) != true)
{
Errors += "INVALID GATEWAY ADDRESS\n";
}
if (string.IsNullOrEmpty(Errors))
{

GlobalClass.IP = NewIP.Text;
GlobalClass.Mask = NewSM.Text;
GlobalClass.Gateway = NewGW.Text;
Close();
}
else {
MessageBox.Show(Errors, "Error");
}
}

private void BtnCnl_Click(object sender, EventArgs e) => Close();
public void BtnOk_Click(object sender, EventArgs e)
{
string Errors = null;
//&& IsAddressValid(NewSM.Text) == true && IsAddressValid(NewGW.Text) == true
if (IsAddressValid(NewIP.Text) != true)
{
Errors += "INVALID IP ADDRESS\n";
}
if (IsAddressValid(NewSM.Text) != true)
{
Errors += "INVALID SUBMASK ADDRESS\n";
}
if (IsAddressValid(NewGW.Text) != true)
{
Errors += "INVALID GATEWAY ADDRESS\n";
}
if (string.IsNullOrEmpty(Errors))
{

GlobalClass.IP = NewIP.Text;
GlobalClass.Mask = NewSM.Text;
GlobalClass.Gateway = NewGW.Text;
Close();
}
else {
MessageBox.Show(Errors, "Error");
}
}

private void BtnCnl_Click(object sender, EventArgs e) => Close();
1 replies