How can i access remotely the shared folder file in another machine.I was tried like this.
public void LoadExcelData()
{
string strLogFilePath = @"\\corevodev24.corevo.ind\\Common Files\\microsoft shared\\Web Server Extensions\\15\\TEMPLATE\\LAYOUTS\\Contact.XLSX";
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + strLogFilePath);
NetworkCredential theNetworkCredential = new NetworkCredential(@"robert", "abc123$", "corevo.ind");
CredentialCache theNetCache = new CredentialCache();
theNetCache.Add(new Uri(@"\\corevodev24.corevo.ind"), "Basic", theNetworkCredential);
// C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\Contact.XLSX
System.IO.FileStream stream = System.IO.File.OpenRead("\\corevodev24.corevo.ind\\C$\\Program Files\\Common Files\\microsoft shared\\Web Server Extensions\\15\\TEMPLATE");
FileStream fs = new FileStream(@"\\corevodev24\C$\SharedFolder\Contact.XLSX", FileMode.Open);
StreamReader str = new StreamReader(@"\\corevodev24\C$\SharedFolder\Contact.XLSX");
when i was access the file it was showing access to the path is access denied. someone give me a solution for this i tried lot but same error.The file was stored in another computer.In my system how can i read the Excel file.
My requirement is client system they are having Excel sheet in network shared folder.I want to read that excel file.Someone give me a solution for this.Thank is Advance.