If it is a "php page" then I suppose you are talking about a web page yourself, then in practice you should call the function on your web page, for example teste.php
:
<?php
function retornar() {
$valor = "aa";
return $valor;
}
echo retornar();
Or it might even just be this:
<?php
echo "aa";
And then call the address http://seusite/teste.php
(your site is just an example) on its own c#, you can use Webclient
Call in your C file#
WebClient client = new WebClient();
string downloadString = client.DownloadString("http://seusite/teste.php");
Or save content to a document:
WebClient client = new WebClient ();
client.DownloadFile("http://seusite/teste.php", " C:\conteudo.txt");
Is php your code? can you change it?
– rray
Yes, I can, it’s mine
– rods
Yes it is possible! you need to make a request with C# and in php code you should make one
echo
with the desired format be it a json or plain text, then just take the.– rray
have an example request link for me to read? please
– rods