I am using this code to generate the path of a selected file:
private void LoadNewFile()
{
OpenFileDialog ofd = new OpenFileDialog();
string _xmlPath1 = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
System.Windows.Forms.DialogResult dr = ofd.ShowDialog();
if (dr == DialogResult.OK)
{
userSelectedFilePath = ofd.FileName;
}
}
private void tbFilePath_TextChanged(object sender, EventArgs e)
{
}
Before i used this code to pass the data:
private void btn_compare_Click(object sender, EventArgs e)
{
string x1 = System.IO.File.ReadAllText(@"C:\Users", Encoding.UTF8);
How do i modify it that instead of x1 that takes the path manually, i need it to be equal to xmlPath1 , so string x1 = xmlPath1
_xmlPath1tobtn_compare_Click(...)to use it there