Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

conversion de code asp en asp.net

1 réponse
Avatar
davman1
Bonjour,

j'essaye en vain de convertir ce code ASP en ASP.net quelqu'un peut
m'aider svp?

<PRE>
<%
dim strResponse,destURL,strContent

destURL = "https://secure.metacharge.com/mcpe/corporate"

// Construct the Post Data

strContent = strContent & "intTestMode=" & server.URLencode("1")

strContent = strContent & "&intInstID=" & server.URLencode("242533")

strContent = strContent & "&strCartID=" & server.URLencode("12345")

strContent = strContent & "&strDesc=" & server.URLencode("Description
of Digital goods or service")

strContent = strContent & "&fltAmount=" & server.URLencode("1.00")

strContent = strContent & "&strCurrency=" & server.URLencode("GBP")

strContent = strContent & "&strCardHolder=" & server.URLencode("The
Card holders nameA")

strContent = strContent & "&strPostcode=" & server.URLencode("SW1A
0AA")

strContent = strContent & "&strEmail=" &
server.URLencode("someone@somewhere.com")

strContent = strContent & "&strCardNumber=" &
server.URLencode("1234123412341234")

strContent = strContent & "&strExpiryDate=" & server.URLencode("1205")

strContent = strContent & "&strCardType=" & server.URLencode("VISA")

strContent = strContent & "&strCountry=" & server.URLencode("GB")

strContent = strContent & "&intCV2=" & server.URLencode("123")



// Construct the useragent and send

set http_obj=server.CreateObject("MSXML2.ServerXMLHTTP")

http_obj.Open "POST", destURL , false

http_obj.setRequestHeader "Content-type",
"application/x-www-form-urlencoded"

http_obj.send(strContent)



// Grab the response

strResponse = http_obj.ResponseText

set http_obj=nothing

response.write( strResponse )



%>

</PRE>

merci d'avance

David

1 réponse

Avatar
Patrice
Quel est le problème exact ?

Si tu veux remplacer cet objet COM regarde System.Net.WebClient qui permet
de poster des données vers un formulaire à partir d'une application...

--
Patrice

"davman1" a écrit dans le message de
news:
Bonjour,

j'essaye en vain de convertir ce code ASP en ASP.net quelqu'un peut
m'aider svp?

<PRE>
<%
dim strResponse,destURL,strContent

destURL = "https://secure.metacharge.com/mcpe/corporate"

// Construct the Post Data

strContent = strContent & "intTestMode=" & server.URLencode("1")

strContent = strContent & "&intInstID=" & server.URLencode("242533")

strContent = strContent & "&strCartID=" & server.URLencode("12345")

strContent = strContent & "&strDesc=" & server.URLencode("Description
of Digital goods or service")

strContent = strContent & "&fltAmount=" & server.URLencode("1.00")

strContent = strContent & "&strCurrency=" & server.URLencode("GBP")

strContent = strContent & "&strCardHolder=" & server.URLencode("The
Card holders nameA")

strContent = strContent & "&strPostcode=" & server.URLencode("SW1A
0AA")

strContent = strContent & "&strEmail=" &
server.URLencode("")

strContent = strContent & "&strCardNumber=" &
server.URLencode("1234123412341234")

strContent = strContent & "&strExpiryDate=" & server.URLencode("1205")

strContent = strContent & "&strCardType=" & server.URLencode("VISA")

strContent = strContent & "&strCountry=" & server.URLencode("GB")

strContent = strContent & "&intCV2=" & server.URLencode("123")



// Construct the useragent and send

set http_obj=server.CreateObject("MSXML2.ServerXMLHTTP")

http_obj.Open "POST", destURL , false

http_obj.setRequestHeader "Content-type",
"application/x-www-form-urlencoded"

http_obj.send(strContent)



// Grab the response

strResponse = http_obj.ResponseText

set http_obj=nothing

response.write( strResponse )



%>

</PRE>

merci d'avance

David