## understanding some code

Hello,

i need some help on understanding some code. It's code to generate a password from an 8 digit input.
i think it should be fairly easy for someone with a bit of experience.
you have to excuse me if this isn't visual basic .net code, i think it is, but i'm not completely sure.

Code:
```  internal class CodeDecode
{
private int mivInputCode;
private int mivOutputCode;

public bool CheckInputCode(string psvInputCode)
{
return psvInputCode.Length == 8 && int.TryParse(psvInputCode, out this.mivInputCode) && this.mivInputCode >= 0;
}

public string CalculateOutputCode()
{
int[] numArray1 = new int[8];
int[] numArray2 = new int[8];
for (int index = 0; index < 8; ++index)
numArray1[index] = this.mivInputCode % this.Power(10, index + 1);
numArray2[0] = numArray1[0];
for (int pivNumber2 = 1; pivNumber2 < 8; ++pivNumber2)
numArray2[pivNumber2] = (numArray1[pivNumber2] - numArray1[pivNumber2 - 1]) / this.Power(10, pivNumber2);
this.mivOutputCode = 1 + numArray2[1] + this.Power(3, numArray2[2]) + numArray2[3] + this.Power(5, numArray2[4]) + this.Power(4, numArray2[5]) + this.Power(7, numArray2[6]) + this.Power(2, numArray2[7]);
return this.mivOutputCode.ToString();
}

private int Power(int pivNumber1, int pivNumber2)
{
int num = pivNumber1;
if (pivNumber2 == 0)
num = 1;
if (pivNumber2 == 1)
num = pivNumber1;
if (pivNumber2 > 1)
{
for (int index = 1; index < pivNumber2; ++index)
num *= pivNumber1;
}
return num;
}

public void WriteToFile(string psvFileName)
{
SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Text files (*.txt)|*.txt";
saveFileDialog.FileName = psvFileName;
int num = (int) saveFileDialog.ShowDialog();
psvFileName = saveFileDialog.FileName;
using (StreamWriter text = File.CreateText(psvFileName))
{
text.WriteLine((string) (object) DateTime.Now + (object) text.NewLine);
text.WriteLine("Input Code : {0}  (D1000)", (object) this.mivInputCode);
text.WriteLine("Output Code: {0}", (object) this.mivOutputCode);
text.Close();
}
}
}```
if anyone could translate this for me, i would be very thankful.