Hola a todos, quisiera hacer la lectura del codigo fuente de un archivo .php en el estilo forosdelweb.com/index.php donde el archivo esta en la web y tiene extencion .php, intente con :
Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
StreamReader objReader;
string AbrirURL;
string sLine;
public Form1()
{
InitializeComponent();
// no lo pude poner bien por no me deja postearlo pero con el http y los www lo puse
AbrirURL = "forosdelweb.com/index.php";
sLine = "";
}
private void button1_Click(object sender, EventArgs e)
{
objReader = new StreamReader(AbrirURL);
while (this.sLine != null)
{
this.sLine = objReader.ReadLine();
if (sLine != null)
this.AreaTexto.Text = this.AreaTexto.Text + this.sLine + "\n";
}
objReader.Close();
this.sLine = "";
}
}
}
Al ir a buscar la url se cae.
Saludos y gracias de antemano.