string input = "";
string result = "";
if (Directory.Exists(Path.GetDirectoryName(filePath)))
{
if (File.Exists(filePath))
{
input = File.ReadAllText(filePath).ToString();
List<byte> bList = new List<byte>();
for (int i = 0; i < input.Length; i += 8)
{
bList.Add(Convert.ToByte(input.Substring(i, 8), 2));
}
result = Encoding.UTF8.GetString(bList.ToArray());
return result;
}
Exception occurs in Substring inside the for loop
Help me to get rid of this exception.
Thanks in Advance
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…