1

I want to get datas from an html file on my asp webserver, in Javascript to get actual host we can use the following:

~/mydatas.php

It gives on localhost: "http://localhost/mydatas.php"

I want the same thing but in C# can you help me?

Thanks you.

flofreelance
  • 944
  • 3
  • 14
  • 31

2 Answers2

1

You could also search in stackoverflow and you will find a lot of answered question which had the same problematic than you. Like this one

Hopes it will help you !

Edit : You can use

HttpContext.Current.Request.Url.AbsoluteUri

It will give you the URL of your web page.

Community
  • 1
  • 1
Kenta
  • 71
  • 4
0

I've already try

HttpContext.Current.Request.Url.Host 

which gives on localhost

:\windows\system32\inetsrv\localhost

...

flofreelance
  • 944
  • 3
  • 14
  • 31