C
Corey Masson
Hello to all,
Here is my situation.
I have an old .ASP application that is doing the
following:
Uses Request.ServerVariables("Auth_User") to get the
domain name\username from the web server.
It then takes this value and validates it from a User
tables primary key field in MS SQL
Problem, I am porting over this app to .Net and I have to
keep this basic functionality.
When I try to get values from Request.ServerVariables in
C# i get nothing.
When i do the following logic, USER_AUTH does not even
appear in my collection:
int loop1, loop2;
NameValueCollection coll;
// Load Header collection into
NameValueCollection object.
coll=Request.Headers;
// Put the names of all keys into
a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0;
loop1<arr1.Length; loop1++)
{
Response.Write("Key: " +
arr1[loop1] + "<br>");
// Get all values under
this key.
String[]
arr2=coll.GetValues(arr1[loop1]);
for (loop2 = 0;
loop2<arr2.Length; loop2++)
{
Response.Write
("Value " + loop2 + ": " + arr2[loop2] + "<br>");
}
}
What am I doing wrong?
Corey
Here is my situation.
I have an old .ASP application that is doing the
following:
Uses Request.ServerVariables("Auth_User") to get the
domain name\username from the web server.
It then takes this value and validates it from a User
tables primary key field in MS SQL
Problem, I am porting over this app to .Net and I have to
keep this basic functionality.
When I try to get values from Request.ServerVariables in
C# i get nothing.
When i do the following logic, USER_AUTH does not even
appear in my collection:
int loop1, loop2;
NameValueCollection coll;
// Load Header collection into
NameValueCollection object.
coll=Request.Headers;
// Put the names of all keys into
a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0;
loop1<arr1.Length; loop1++)
{
Response.Write("Key: " +
arr1[loop1] + "<br>");
// Get all values under
this key.
String[]
arr2=coll.GetValues(arr1[loop1]);
for (loop2 = 0;
loop2<arr2.Length; loop2++)
{
Response.Write
("Value " + loop2 + ": " + arr2[loop2] + "<br>");
}
}
What am I doing wrong?
Corey