My code is as follows: I used the File.Exists(path) but this doesn't seem to work. Would appreciate all help.
using System;
using System.IO;
private async void Search_Click(object sender, RoutedEventArgs e)
{
String path = @"C:\Users\Karan\OneDrive\Desktop\2010.pdf";
String t = Main(path);
if (t=="1")
{
Test.Text = "1";
}
if (t=="0")
{
Test.Text = "0";
}
}
public static string Main(String path)
{
String t;
if(File.Exists(path))
{
t = "1";
}
else
{
t = "0";
}
return t;
}
Thank you.