Domain name disponibility

wildjack

Client
Регистрация
19.07.2013
Сообщения
93
Благодарностей
8
Баллы
8
Hi

I recently found a c# code i would like to use with zenno.

using System.IO;
using System.Net;

namespace NDD
{
class Program
{
static void Main(string[] args)
{
using (StreamReader reader = File.OpenText(@"C:\Domains.txt"))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
WebResponse response = WebRequest.Create("https://testapi.internet.bs/Domain/Check?ApiKey=testapi&Password=testpass&Domain=" + line).GetResponse();
using (StreamReader sr = new StreamReader(response.GetResponseStream()))
{
if (sr.ReadToEnd().Contains("=AVAILABLE"))
{
using (StreamWriter w = File.AppendText(@"C:\AvailableDomains.txt"))
{
w.WriteLine(line);
}
}
}
}
}
}
}
}

But i got this message, can someone help with that ? :

Type Source Message
Code compilation "} attendue". [Row: 2; Column: 18]
Code compilation "Jeton 'namespace' non valide dans la déclaration de membres de la classe, de la structure ou de l'interface". [Row: 4; Column: 1]
Code compilation "Définition de type ou d'espace de noms, ou fin de fichier attendue". [Row: 33; Column: 1]
Code compilation "Un espace de noms ne peut pas contenir directement des membres tels que des champs ou des méthodes". [Row: 31; Column: 1]
Code compilation "Jeton '{' non valide dans la déclaration de membres de la classe, de la structure ou de l'interface". [Row: 5; Column: 1]
Code compilation "Définition de type ou d'espace de noms, ou fin de fichier attendue". [Row: 34; Column: 1]

ty
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
I do not think you need c# for this...

Just use lists for this file C:\Domains.txt
then take line from this list and make GET request to url https://testapi.internet.bs/Domain/Check?ApiKey=testapi&Password=testpass&Domain= + line taken from list

And you will have response...

Then do regex on your response and if domain is available save it in other list what is added to file C:\AvailableDomains.txt as per this code.

About c#: you can not simple copy any code from net and it will work in zenno...
 

wildjack

Client
Регистрация
19.07.2013
Сообщения
93
Благодарностей
8
Баллы
8
Thanks very much i will use that
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)