it cannot be stored in an integer value... You have to store it in string if you want it to be stored in this pattern.
You can use below command
int count = 0;
count = 000000 + i;
string customFormat = "000000";
string strVal = count.ToString(customFormat);
sw.write(strVal);