I am developing a winform application on C# where I need to access a network folder but i get logon user password exception. How can i provide user credentials through application?
double length = ((Directory.GetFiles("\\192.168.50.107\Destination", "*", SearchOption.AllDirectories).Sum(t => (new FileInfo(t).Length)) / 1024) / 1024) / 1024;