Click here to Skip to main content
15,900,511 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionusing recordset in MS Access to place values into array Pin
reegan4115-Jun-07 3:20
reegan4115-Jun-07 3:20 
AnswerRe: using recordset in MS Access to place values into array Pin
GoodID21-Jun-07 17:56
GoodID21-Jun-07 17:56 
Questioncan any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 3:08
professionalkoolprasad200315-Jun-07 3:08 
AnswerRe: can any one tell reular exp to validate domain name Pin
Tom Wright15-Jun-07 3:53
Tom Wright15-Jun-07 3:53 
GeneralRe: can any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 21:15
professionalkoolprasad200315-Jun-07 21:15 
AnswerRe: can any one tell reular exp to validate domain name Pin
berghain15-Jun-07 4:47
berghain15-Jun-07 4:47 
GeneralRe: can any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 21:13
professionalkoolprasad200315-Jun-07 21:13 
AnswerRe: can any one tell reular exp to validate domain name Pin
Steven J Jowett15-Jun-07 5:46
Steven J Jowett15-Jun-07 5:46 
A regular expression for validating domain names as follows:-

^[a-zA-Z0-9]+([a-zA-Z0-9]\-\.]+)?\.(com|org|net|info|biz|co.uk|org.uk|net.uk|gov|gov.uk)$

But I prefer to use the following function, as I actually checks to see if the domain is hosted :-

Public Function IsWebAddressActive(ByVal URL As String) As Boolean<br />
        Try<br />
            Dim req As System.Net.HttpWebRequest<br />
            Dim res As System.Net.HttpWebResponse<br />
<br />
            req = System.Net.HttpWebRequest.Create(URL)<br />
            'set the user agent <br />
            'some site might brush you off if it is not set (to stop bots and scrapers) <br />
            req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)"<br />
<br />
            'get response from website<br />
            res = req.GetResponse()<br />
            res.Close()<br />
            Return True<br />
        Catch<br />
            Return False<br />
        End Try<br />
    End Function


and to use it, you would call it as follows:-

Dim bIsWebSiteActive as boolean<br />
bIsWebSiteActive = IsWebAddressActive("http://www.codeproject.com")


which, hopefully with return True, or if the website is not online it would return False



Steve Jowett
-------------------------
Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'

GeneralRe: can any one tell reular exp to validate domain name Pin
koolprasad200315-Jun-07 21:13
professionalkoolprasad200315-Jun-07 21:13 
QuestionTransfer Datetime field from MS-Access to SQL server? Pin
.NetRams15-Jun-07 2:11
.NetRams15-Jun-07 2:11 
AnswerRe: Transfer Datetime field from MS-Access to SQL server? [modified] Pin
GuyThiebaut15-Jun-07 9:26
professionalGuyThiebaut15-Jun-07 9:26 
GeneralOutput From Stored Procedures Pin
Dreamer200715-Jun-07 1:52
Dreamer200715-Jun-07 1:52 
GeneralRe: Output From Stored Procedures Pin
Tom Wright15-Jun-07 3:44
Tom Wright15-Jun-07 3:44 
GeneralRe: Output From Stored Procedures Pin
Dreamer200715-Jun-07 20:47
Dreamer200715-Jun-07 20:47 
GeneralRe: Output From Stored Procedures Pin
.NetRams16-Jun-07 0:18
.NetRams16-Jun-07 0:18 
GeneralRe: Output From Stored Procedures Pin
Xandip16-Jun-07 2:24
Xandip16-Jun-07 2:24 
Questionhow can i validate a URL using vb.net Pin
koolprasad200315-Jun-07 1:25
professionalkoolprasad200315-Jun-07 1:25 
AnswerRe: how can i validate a URL using vb.net Pin
Dave Sexton15-Jun-07 2:04
Dave Sexton15-Jun-07 2:04 
AnswerRe: how can i validate a URL using vb.net Pin
Craster15-Jun-07 2:08
Craster15-Jun-07 2:08 
GeneralRe: how can i validate a URL using vb.net Pin
Tom Wright15-Jun-07 3:51
Tom Wright15-Jun-07 3:51 
Question"Array index out of bounds exception " after Deleting last row from Datagrid Pin
V.G15-Jun-07 1:04
V.G15-Jun-07 1:04 
AnswerRe: "Array index out of bounds exception " after Deleting last row from Datagrid Pin
Dave Sexton15-Jun-07 1:42
Dave Sexton15-Jun-07 1:42 
GeneralRe: "Array index out of bounds exception " after Deleting last row from Datagrid Pin
V.G15-Jun-07 2:25
V.G15-Jun-07 2:25 
QuestionHow to write to file from www project ? Pin
porsti15-Jun-07 0:43
porsti15-Jun-07 0:43 
AnswerRe: How to write to file from www project ? Pin
.NetRams15-Jun-07 2:13
.NetRams15-Jun-07 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.