Hi Can Someone Please Tell Me What This Does I Have A Very Brief Understanding Of Code?
[STAThread]
public static void Main()
{
string name = MyProject.Computer.Name;
string str2 = "False";
int[] numArray = new int[5];
string str4 = "";
Console.WriteLine("Computer Name: " + name);
if (name.Length != 7)
{
str2 = "Invalid PC Name to set password (LEN<>7)";
}
if (!name.ToUpper().Contains("NT-"))
{
str2 = "Invalid PC Name to set password (CONT=NT-)";
}
if (str2 == "False")
{
try
{
int num3;
string str3 = Strings.Split(name, "-", -1, CompareMethod.Binary)[1];
int index = 0;
do
{
numArray[index] = Conversions.ToInteger(str3.Substring(index, 1));
index++;
num3 = 3;
}
while (index <= num3);
int num = (numArray[2] + numArray[3]) * 2;
if (num < 10)
{
str4 = "0" + Conversions.ToString(num);
}
else
{
str4 = Conversions.ToString(num);
}
str4 = str4 + "I4ai;#";
object[] arguments = new object[] { str4 };
bool[] copyBack = new bool[] { true };
NewLateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.GetObject("WinNT://./Administrator,user", null)), null, "SetPassword", arguments, null, null, copyBack, true);
if (copyBack[0])
{
str4 = (string) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(string));
}
Console.WriteLine("Password Set");
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
Console.WriteLine("Failed to set new password:");
Console.WriteLine(exception.ToString());
ProjectData.ClearProjectError();
}
}
else
{
Console.WriteLine("Failed to set new password:");
Console.WriteLine(str2);
}
}
5 0x5[STAThread]
public static void Main()
{
string name = MyProject.Computer.Name;
string str2 = "False";
int[] numArray = new int[5];
string str4 = "";
Console.WriteLine("Computer Name: " + name);
if (name.Length != 7)
{
str2 = "Invalid PC Name to set password (LEN<>7)";
}
if (!name.ToUpper().Contains("NT-"))
{
str2 = "Invalid PC Name to set password (CONT=NT-)";
}
if (str2 == "False")
{
try
{
int num3;
string str3 = Strings.Split(name, "-", -1, CompareMethod.Binary)[1];
int index = 0;
do
{
numArray[index] = Conversions.ToInteger(str3.Substring(index, 1));
index++;
num3 = 3;
}
while (index <= num3);
int num = (numArray[2] + numArray[3]) * 2;
if (num < 10)
{
str4 = "0" + Conversions.ToString(num);
}
else
{
str4 = Conversions.ToString(num);
}
str4 = str4 + "I4ai;#";
object[] arguments = new object[] { str4 };
bool[] copyBack = new bool[] { true };
NewLateBinding.LateCall(RuntimeHelpers.GetObjectValue(Interaction.GetObject("WinNT://./Administrator,user", null)), null, "SetPassword", arguments, null, null, copyBack, true);
if (copyBack[0])
{
str4 = (string) Conversions.ChangeType(RuntimeHelpers.GetObjectValue(arguments[0]), typeof(string));
}
Console.WriteLine("Password Set");
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception exception = exception1;
Console.WriteLine("Failed to set new password:");
Console.WriteLine(exception.ToString());
ProjectData.ClearProjectError();
}
}
else
{
Console.WriteLine("Failed to set new password:");
Console.WriteLine(str2);
}
}