![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#13
|
||||
|
||||
|
Club Delphi,
Cita:
![]() Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Net.NetworkInformation;
namespace TestClubDelphi
{
class Program
{
static bool CodeHtml(string Url)
{
HttpWebRequest Request = (HttpWebRequest)WebRequest.Create(Url);
Request.Method = "GET";
WebResponse reply = Request.GetResponse();
string html;
try
{
using (StreamReader sr = new StreamReader(reply.GetResponseStream(), Encoding.UTF8))
{
html = sr.ReadToEnd();
using (StreamWriter sw = File.CreateText(@"C:\ClubDelphi.html"))
{
sw.WriteLine(html);
}
}
return true;
}
catch(Exception e)
{
Console.WriteLine(e.Message);
return false;
}
finally
{
reply.Close();
}
}
static void Main(string[] args)
{
IPHostEntry address = Dns.GetHostEntry("www.clubdelphi.com");
Ping Pings = new Ping();
int timeout = 10000;
if (Pings.Send(address.AddressList[0], timeout).Status == IPStatus.Success)
{
if (CodeHtml("http://www.clubdelphi.com"))
{
Console.WriteLine("Club Delphi esta Online");
}
else
{
Console.WriteLine("Llamar a Casimiro :)");
}
}
else
{
Console.WriteLine("Llamar a Casimiro :)");
}
Console.ReadKey();
}
}
}
![]() Nelson. |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Evento al entrar al Form | lunygar | Varios | 5 | 11-01-2008 17:54:28 |
| cuando llamo ejecutar un hilo dentro del proceso del hilo no lo hace | robertosc | Varios | 1 | 14-08-2007 22:11:09 |
| No me deja entrar xp a pc con win98 se ! | Arturo | Windows | 0 | 15-05-2006 22:46:43 |
| No me deja entrar al Interbase | nuri | Firebird e Interbase | 2 | 14-07-2005 12:58:02 |
| Cómo entrar a la disco | roman | Humor | 24 | 31-05-2004 19:34:56 |
|