473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

c# e vb net con system.net.socket

Ragazzi,
leggevo su masterdrive di questo codice che in c# funziona benissimo
mentre se convertito in VB (come sotto) si blocca o, se funziona, riceve
la risposta dal server whois dopo un infinitą di tempo. Possibile che il
c# funzioni meglio del VB ? Ma il codice non viene compilato in CLR ?

public function checkDomain(strDomain as String, extDomain as String)
try
'connessione all host
dim objTcp as TcpClient = new TcpClient("whois.nic.it", 43)
dim domain as string = strDomain + "." + extDomain + "\r\n"
dim arrDomain as byte() = Encoding.ASCII.GetBytes(domain)
'invio della richiesta e attesa della risposta
dim ObjStream as Stream = objTcp.GetStream()
ObjStream.Write(arrDomain, 0, domain.Length)
dim objSr as StreamReader = new StreamReader(objTcp.GetStream(),
Encoding.ASCII)
'registro la risposta
dim result as string = Regex.Replace(objSr.ReadToEnd(),"\n","<br>")
'controllo l'esistenza
if result.IndexOf("No entries found") <> -1 then
return "dominio disponibile"
else
return "dominio non disponibile"
end if
objTcp.Close()
catch e as exception
return e.ToString()
end try
end function

Nov 19 '05 #1
0 726

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sagaert Johan | last post by:
i get this error if i write this : using System.Net.Sockets; .... .... TcpClient tcp; tcp=new TcpClient();
0
by: Sagaert Johan | last post by:
this code using System; using System.Net.Sockets; namespace ConsoleApplication1 { /// <summary> /// Summary description for Class1. /// </summary>
1
by: Frank Jones | last post by:
When I call Dns.GetHostByName(Dns.GetHostName()) on one of our lab boxes I get the below exception. I've seen posts saying others in these newsgroups have seen similar issues since moving to .Net....
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
2
by: Stressed Out Developer | last post by:
We have an application that has a 200 count loop that does the following: ' Each time thru the loop we pass the next IP Address is a range (aka 192.168.4.50 thru 192.168.4.254) Try If...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
6
by: Aero | last post by:
Hi, My window application written in C# is throwing following exception while connecting to one FTP location The type initializer for System.Net.Sockets.Socket threw an exception This exe is...
4
by: sd1978 | last post by:
Hi, I have placed a webservice in the webserver. When I access it from a webpage, default.aspx on a click of a button i get the following error: No connection could be made because the target...
8
by: JDavis | last post by:
I am using System.Net.Sockets to connect a client socket to a server that requires three inputs when I connect: host, port and an identification number that identifies the person connecting. ...
2
by: =?Utf-8?B?VmlqYXk=?= | last post by:
Hi, I am calling an external web service that returns some data which is being displayed on my ASP.NET page. This page refreshes every 60 seconds and pulls the updated data from the web service....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.