private void opnBtn_Click(object sender, EventArgs e)
{
string oldPath;
OpenFileDialog fdlg = new OpenFileDialog();
fdlg.InitialDirectory = @"H:\";
fdlg.Filter = "All files (*.*), |*.*";
fdlg.FilterIndex = 2;
fdlg.RestoreDirectory = true;
if (fdlg.ShowDialog() == DialogResult.OK)
{
oldPath = fdlg.FileName;
string backSlashSch = "\\";
string backSlashPos = oldPath.Substring(0, oldPath.LastIndexOf("\\") + 1);
int backPos = oldPath.LastIndexOf(backSlashSch);
int endOfPath = oldPath.Length;
int calcPos = (endOfPath - backPos - 1);
string newPath = oldPath.Insert(calcPos, "1");
MessageBox.Show(oldPath);
MessageBox.Show(backSlashPos);
MessageBox.Show(backPos.ToString());
MessageBox.Show(endOfPath.ToString());
MessageBox.Show(calcPos.ToString());
MessageBox.Show(newPath);
pathDsp.Text= (oldPath + " " + backSlashPos + " " + backSlashPos + " " + endOfPath + " " + calcPos + " " + newPath);
}
}