private void Form1_Load(object sender, EventArgs e)
{
##################################
##################################
calling of varriables that you do not need to see :-)
##################################
##################################
foreach (string line in File.ReadAllLines("C:\\IP_DATA.txt"))
{
string[] parts = line.Split(' ');
foreach (string part in parts)
{
string[] regreturn = myvar.Split(';');
foreach (string MyVal in regreturn)
{
if (MyVal.ToUpper().ToString() == part.ToUpper().ToString())
{
string NetDomCommand = "NETDOM ADD " + parts[1].ToUpper().ToString() + " /Domain:" +
TRDomain.ToString() + " /Userd:" + UserID.ToString() + " /Passwordd:" +
UserPW.ToString() l";
try
{
ExecuteCommand(NetDomCommand.ToString(), 0);
}
catch (Exception trs)
{
MessageBox.Show("{0}} Second exception caught.", trs.ToString());
}
}
}
i++;
}
}
} |