Problem to get Windows Logon ID & read file at the same time

G

genzy

I'm facing the below problem.

With <deny users="?" />, the Windows Login ID is able to be obtained to
fill up the Windows IDSID text field automatically, but reading the
file info is failed.

Without <deny users="?" />, the Windows Login ID is not able to be
obtained, but reading the file info is successful.

Is there any way to make both working at the same time?
Thanks for advice.

Windows Logon ID - To get its value
CODE:
private string GetLogonUserIdsid()
{
string logonUserId = "";
string logonUser = Request.ServerVariables["LOGON_USER"];

if (!logonUser.Equals(""))
{
// ASCII Table - http://www.lookuptables.com/
// char '\' = 92
char[] splitter = {(char) 92};
string[] strTmp = logonUser.Split(splitter);
logonUserId = strTmp[1];
} // End if.

return logonUserId;
}

File Access - To check a file existence
CODE:
if (File.Exists(dir+file)) {
return true;
}
else {
return true;
}

web.config
CODE:
<authorization>
<!-- It will deny all unauthenticated or anonymous users. -->
<deny users="?" />

<!-- Allow all users -->
<allow users="*" />

<!-- Note -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top