|
Check for a valid URL
|
Total Hit (4026) |
Before posting an Internet request you should check that the user has entered a valid Internet address. You can do this with a parsing routine, or use the following routine based on the IE5 library:
«Code LangId=1»
Private Declare Function IsValidURL Lib "urlmon" (ByVal pBC As Long, _
url A
....Read More |
Rating
|
|
|
Check whether RAS is installed
|
Total Hit (3189) |
When you work with RAS APIs, you should have to make sure if RAS library is installed on the system. A simple way is to verify the existence of the Rasapi32.dll file in the windows system directory; the same thing can be obtained with a call to the InternetGetConnectedState API, as the following cod
....Read More |
Rating
|
|
|
Check whether the user is working off-line
|
Total Hit (3471) |
Internet Explorer offers the possibility to simulate an Internet connection with the off-line mode. If you want to know if off-line mode is on or off you can use InternetQueryOption API.
«Code LangId=1»
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_DISCONNECTED_BY_USER = &H10
....Read More |
Rating
|
|
|
Create an Internet shortcut
|
Total Hit (2831) |
Unlike regular LNK shortcut, which contain data in binary file, Internet shortcut files are just text files in this format:
[InternetShortcut]
URL=www.domain.com
Thus it is simple to programmatically create an Internet shortcut that, when double-clicked, will load the default browser and hav
....Read More |
Rating
|
|
|
Resolve an internet host address
|
Total Hit (2837) |
The System.Net.Dns class exposes a few static methods that let you resolve an internet domain name - such as www.vb2themax.com - into a 4-part numeric IP address, also known as dotted-quad notation.
The Resolve static method takes a string and returns an IPHostEntry object; you can learn the actu
....Read More |
Rating
|
|
|
Caveats of the CopyMemory API function
|
Total Hit (4193) |
Here's the correct declaration of the CopyMemory API function, which is so useful whenever you want to move a block of bytes between two memory locations:
«Code LangId=2»
Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, _
source As Any, ByVal bytes As Long)
«/Code
....Read More |
Rating
|
|
|
Determine whether an API function is available
|
Total Hit (3549) |
In many cases you may want to call an API function, but you aren't sure whether the Windows version the application is running on supports that particular function.
The easiest way to test whether a function exists and can be called is to replicate through VB code what Windows itself would do whe
....Read More |
Rating
|
|
|
Extract null-delimited strings
|
Total Hit (3757) |
Most API function that return a string require that you pass a buffer where they can place the result as a null-terminated ANSI string (a.k.a. ASCIIZ string). The calling code must then extract the string by taking all the characters up to the first Chr$(0) character, if there is one. For example, t
....Read More |
Rating
|
|
|
Mail Tutorial in VB.NET
|
Total Hit (3369) |
Microsoft has made life more easy by adding an in-built .NET class for SMTP Mail. This article will show you how you can take advantage of System.Web.Mail namespace in VB.Net
«B»Basic Mail Message«/B»
«Code LangId=2»
Imports System.Web.Mail
Dim m As New System.Web.Mail.MailMessage()
Wi
....Read More |
Rating
|
|
|
|
|
|
|
|
|
A Google-like Full Text Search
|
Total Hit (4602) |
Thanks to Internet search engines like Google and Yahoo!, your search application users are more sophisticated and demanding than ever. Your application users have a wealth of search application knowledge that they're probably not even aware of. Ask one of them to find a website dedicated to their f
....Read More |
Rating
|
|