M
Maras
Hi,
i have a protected part of application ("security" subdirectory is
protected by authentication mode="Forms").
i'd like to give a user a option to printfriendly version of content a page
in this directory.
in my printfriendly script i try to get a content of a page and then with
RegEx object to filter this content:
***
Dim URL as String = "http://myserver/security/test.aspx"
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(URL), _
HttpWebRequest)
' Sends the request and waits for a response.
Dim myHttpWebResponse As HttpWebResponse = _
CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8")
' Pipes the response stream to a higher level stream reader with the
' required encoding format.
Dim readStream As New StreamReader(receiveStream, encode)
Dim myHTML As String
myHTML = readStream.ReadToEnd
[...]
***
when i try to get the html code in not protected directory everything works
fine, but in security directory this myHttpWebRequest is probably not
authenticated and i get only my login page... i don't know why
myHttpWebRequest is not authenticated, i try to start this request in
security part, so after login, it should be authenticated.
have you any ideas to solve this problem?
thanks a lot.
i have a protected part of application ("security" subdirectory is
protected by authentication mode="Forms").
i'd like to give a user a option to printfriendly version of content a page
in this directory.
in my printfriendly script i try to get a content of a page and then with
RegEx object to filter this content:
***
Dim URL as String = "http://myserver/security/test.aspx"
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create(URL), _
HttpWebRequest)
' Sends the request and waits for a response.
Dim myHttpWebResponse As HttpWebResponse = _
CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream = myHttpWebResponse.GetResponseStream()
Dim encode As Encoding = System.Text.Encoding.GetEncoding("utf-8")
' Pipes the response stream to a higher level stream reader with the
' required encoding format.
Dim readStream As New StreamReader(receiveStream, encode)
Dim myHTML As String
myHTML = readStream.ReadToEnd
[...]
***
when i try to get the html code in not protected directory everything works
fine, but in security directory this myHttpWebRequest is probably not
authenticated and i get only my login page... i don't know why
myHttpWebRequest is not authenticated, i try to start this request in
security part, so after login, it should be authenticated.
have you any ideas to solve this problem?
thanks a lot.