By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

Getting and sending data from third party software

P: n/a
Hi, I have a third party software that needs to send
information to an .aspx page for processing to communicate
with an SQL database. The software sends the information
something like this:

Mypage.aspx?Password=Mypassword

When this request hits the page, I need to pull that
variable Mypassword to use in my VB function to query the
database. I'm confused on how to get it. I tried using
Request.Form("password") and Request.QueryString
("password") but it doesn't work. I'm also going to have
to send a response back to this other software (Authorware
Macromedia). Anyone know how this should be done?
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Request.Querystring should work. I believe it is case sensitive though. So
you need to use Request.Querystring.Item("Password")

"Beryl Small" <be********@computechsi.com> wrote in message
news:04****************************@phx.gbl...
Hi, I have a third party software that needs to send
information to an .aspx page for processing to communicate
with an SQL database. The software sends the information
something like this:

Mypage.aspx?Password=Mypassword

When this request hits the page, I need to pull that
variable Mypassword to use in my VB function to query the
database. I'm confused on how to get it. I tried using
Request.Form("password") and Request.QueryString
("password") but it doesn't work. I'm also going to have
to send a response back to this other software (Authorware
Macromedia). Anyone know how this should be done?

Nov 18 '05 #2

P: n/a
Okay, I figured out how to get the value from the URL.
Request.Querystring works, but I don't know how to get the
value returned from the result of my SQL query back to
authorware. I need to be able to post the result to the
same page that executed Query. Anyone know how to do this?
-----Original Message-----
Hi, I have a third party software that needs to send
information to an .aspx page for processing to communicatewith an SQL database. The software sends the information
something like this:

Mypage.aspx?Password=Mypassword

When this request hits the page, I need to pull that
variable Mypassword to use in my VB function to query the
database. I'm confused on how to get it. I tried using
Request.Form("password") and Request.QueryString
("password") but it doesn't work. I'm also going to have
to send a response back to this other software (AuthorwareMacromedia). Anyone know how this should be done?
.

Nov 18 '05 #3

P: n/a
Well that depends on a few things. You could create a form with the data and
post it to the third party, but I would look into WebRequest/Response. Here
is an example I have snipped, it may need to be changed to work. Also check
this site out.
http://west-wind.com/presentations/d...WebRequest.htm

Public Shared Function mgGetWebcontent(strWebSite as string, strWebPage as
string, strPostData as string, Optional intContentType as int32 = 0,
Optional httpFile as httpPostedFile = nothing) as string

Dim mgWebRequest As HttpWebRequest
Dim mgWebResponse As HttpWebResponse
Dim strText As String
Dim mgStreamReader As StreamReader

Try
mgWebRequest =CType(WebRequest.Create(strWebSite &
strWebPage),HttpWebRequest)
mgWebRequest.timeout = 90000
mgWebRequest.CookieContainer = new cookiecontainer()
dim k as int32
Dim siteUri As New Uri(strWebSite)
for k = 0 to HttpContext.Current.Request.Cookies.count - 1
'add your cookies here
dim ck as cookie = new cookie()
ck.name = HttpContext.Current.Request.Cookies(k).name
next k
mgWebRequest.UserAgent =
HttpContext.Current.Request.Headers("User-Agent")
mgWebRequest.Accept =
HttpContext.Current.Request.Headers("Accepts")

mgWebRequest.headers.add("Cookie",HttpContext.Curr ent.Request.Headers("Cooki
e"))

if strPostData.length > 0 or not httpfile is nothing then

mgWebRequest.Method = "POST"

select case intContentType
Case = 1 'file post
' separate function snipped out will post if you need it
Case else
mgWebRequest.ContentType = "application/x-www-form-urlencoded"
mgWebRequest.ContentLength = strPostData.length 'length
Dim mgStreamWriter As new
StreamWriter(mgWebRequest.GetRequestStream())

mgStreamWriter.Write(strPostData)
mgStreamWriter.Close()
end select
else
mgWebRequest.Method = "GET"
end if
mgWebResponse = CType(mgWebRequest.GetResponse(),HttpWebResponse)

' you may not need the next part if you don't need the response cookies
and text

mgWebResponse.cookies =
mgWebrequest.CookieContainer.GetCookies(mgWebreque st.RequestUri)
mgStreamReader = New StreamReader(mgWebResponse.GetResponseStream())

strText = mgStreamReader.ReadToEnd()
dim i as int32

for i = 0 to mgWebResponse.cookies.count - 1
'add cookies to response
dim hc as httpcookie
hc = new httpcookie(mgWebResponse.cookies.item(i).name)
hc.expires = datetime.now.addyears(50)
hc.path = mgWebResponse.cookies.item(i).path
HttpContext.Current.Response.AppendCookie(hc)
next i
mgStreamReader.Close()
return strText

Catch
'catch processing snipped
end try
End function

"Beryl Small" <ber
yl*****@computechsi.com> wrote in message
news:18****************************@phx.gbl...
Okay, I figured out how to get the value from the URL.
Request.Querystring works, but I don't know how to get the
value returned from the result of my SQL query back to
authorware. I need to be able to post the result to the
same page that executed Query. Anyone know how to do this?
-----Original Message-----
Hi, I have a third party software that needs to send
information to an .aspx page for processing to

communicate
with an SQL database. The software sends the information
something like this:

Mypage.aspx?Password=Mypassword

When this request hits the page, I need to pull that
variable Mypassword to use in my VB function to query the
database. I'm confused on how to get it. I tried using
Request.Form("password") and Request.QueryString
("password") but it doesn't work. I'm also going to have
to send a response back to this other software

(Authorware
Macromedia). Anyone know how this should be done?
.

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.