Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Getting and sending data from third party software

Reply
Thread Tools

Getting and sending data from third party software

 
 
Beryl Small
Guest
Posts: n/a
 
      12-01-2003
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?
 
Reply With Quote
 
 
 
 
vMike
Guest
Posts: n/a
 
      12-01-2003
Request.Querystring should work. I believe it is case sensitive though. So
you need to use Request.Querystring.Item("Password")

"Beryl Small" <(E-Mail Removed)> wrote in message
news:048601c3b814$baee6c30$(E-Mail Removed)...
> 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?



 
Reply With Quote
 
 
 
 
Beryl Small
Guest
Posts: n/a
 
      12-02-2003
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?
>.
>

 
Reply With Quote
 
vMike
Guest
Posts: n/a
 
      12-02-2003
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


http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in message
news:184201c3b8e3$03bbc470$(E-Mail Removed)...
> 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?
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create a pdf file in asp.net without using a third party software reju ASP .Net 7 02-21-2007 10:21 AM
Third-party defragmenting software. Aardvark Computer Support 4 02-19-2007 03:14 PM
Looking for Vonage third-party software developer NoPoliticalCalls@gmail.com VOIP 13 10-22-2006 11:48 PM
third-party digicam software scarecrow@picturizer.com Digital Photography 6 02-14-2006 10:40 AM
Getting Third Party Component Suppliers to support NUnit and NUnitASP to support test driven development in web pages Nick Zdunic ASP .Net 0 11-05-2003 10:45 AM



Advertisments