-1

After clicking a button in ASPX page I have to execute a URL

http://127.0.0.1/phptest/sendmail.php?id=+@USERNAME

using VB.net. @USERNAME comes from textbox.

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328

2 Answers2

1

Make an HTTP request if you need to call a URL from VBScript:

username = ...
url = "http://127.0.0.1/phptest/sendmail.php?id=+@" & username

Set req = CreateObject("Msxml2.XMLHttp.6.0")
req.open "GET", url, False
req.send

If req.status = 200 Then
  'request successful
Else
  'request failed
End If
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
0

Try something like that in vbscript :

Dim URL,ws,USERNAME
USERNAME = InputBox("Type your USERNAME","USERNAME","USERNAME")
URL =  "http://127.0.0.1/phptest/sendmail.php?id=+@"& USERNAME &""
set ws = CreateObject("wscript.shell")
ws.run URL
Hackoo
  • 18,337
  • 3
  • 40
  • 70
  • Thank you.Its working but opening that URl in web browser while running – Sandeep Vellaparambil May 15 '15 at 08:15
  • I don't understand your aim ? can you please be more explicit ? this not what do you expect to do ? – Hackoo May 15 '15 at 12:37
  • i have a aspx web form .In that there is a button.If i click that button,it should run a url.No need to show or run the URL in webbrowser. – Sandeep Vellaparambil May 15 '15 at 14:29
  • i have a web form named index.aspx.In that there is a button.Button click code is written in index.aspx.vb.When i run the project broser will open with a button.When i click the button it should run the URL and URL should not show in browser.I need a code for that – Sandeep Vellaparambil May 15 '15 at 16:24