asp.net - File.OpenRead access using UNC path. Impersonation not working? -
is there reason impersonation not seem work unc path using file.openread()? i'm utilizing codeproject's impersonation utility:
i have user rights share i'm passing openread().
this code , it's not accessing file:
try { bool canimp = imp.impersonatevaliduser(impuser, domain, imppwd); filestream fs = file.openread(filepath); logger.debug("file stream opened..."); byte[] b = new byte[fs.length]; fs.read(b, 0, b.length); fs.close(); // code continued
turns out using ip address in impersonation domain, rather friendly domain name. once used friendly domain name, impersonation worked.
Comments
Post a Comment