|
Download a file with one API call
|
Total Hit (3749) |
If you have Internet Explorer 5 or later version, you can use an API call to download a file from the Internet withouth displaying any message box.
«Code LangId=1»
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As Strin
....Read More |
Rating
|
|
|
Get the local IP address using the Internet Transfer Control
|
Total Hit (2623) |
The easiest way to retrieve the IP address assigned to the local machine during an Internet session is by means of the LocalIP property of the Internet Transfer Control:
«Code LangId=1»
MsgBox "IP address= " & Winsock1.LocalIp
«/Code»
Note that getting the same information through API calls
....Read More |
Rating
|
|
|
Launch the default browser on a given URL
|
Total Hit (4110) |
The following routine launches the default browser and loads the specified URL in it. The argument doesn't have to include the HTTP:// prefix. If the operation is successful it returns True.
«Code LangId=1»
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(B
....Read More |
Rating
|
|
|
Open the default program for sending email messages
|
Total Hit (2648) |
The ShellExecute API function recognizes email addresses if they are prefixed by the "mailto:" prefix, and correctly run the default program for sending email messages (e.g. Outlook). This lets you open a window for sending an email and automatically fill the address field. Here's a wrapper routine
....Read More |
Rating
|
|
|
Open the Internet Connection dialog
|
Total Hit (3798) |
The dialog you see when you start an Internet connection is implemented in the RNAUI.DLL file, and the specific function is called RnaDial. To open this dialog from your application you can call this function through the rundll32.exe application (located in Windows directory) specifying the name of
....Read More |
Rating
|
|
|
Put buffering and Response.Flush to good use
|
Total Hit (2495) |
IIS5 enables buffering by default, therefore all the output from your ASP is actually sent to the browser only when the page completes its processing. In many cases this approach improves the overall processing speed, and indirectly makes for a more scalable site. However, buffering has two minor de
....Read More |
Rating
|
|
|
Setting the off-line mode
|
Total Hit (3916) |
You can programmatically set the Internet Explorer off-line mode with the InternetSetOption API, as this code snippet demonstrates:
«Code LangId=1»
Const INTERNET_OPTION_CONNECTED_STATE = 50
Const INTERNET_STATE_CONNECTED = 1
Const INTERNET_STATE_DISCONNECTED = 2
Const INTERNET_STATE_DISCONNE
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Send Email using CDOSYS.
|
Total Hit (4302) |
This code snippet will show you how to send SMTP email using CDOSYS. CDONTS was old library for Win NT which is discontinued in XP and 2000. CDOSYS is more flexible than CDONTS. The follwoing code will work with VB6 and VB.net without any modification.
From this code you will learn
1) How to a
....Read More |
Rating
|
|
|
|
System Internet Connection - Determining How and If Connected
|
Total Hit (2583) |
If you are designing a project which can use an Internet connection, it can be useful to know whether the system is connected or not. There are various methods of doing this, however the most informative and reliable method is to use the WinInet.DLL InternetGetConnectedStateEx API call. The only pro
....Read More |
Rating
|
|
|
Determine whether a file is in the Internet Explorer cache
|
Total Hit (2292) |
If you are creating a shortcut to an Internet file, you will want to know whether it has been visited or not so you can colour it appropriately. This tip shows you how to determine whether a file is in the cache so you can do this.
|
Rating
|
|
|
HTTP file upload from VB
|
Total Hit (3149) |
This ActiveX control allows users to submit a file to a Web server. This component uses the WinSocket control to submit files using the file transfer protocol (FTP). It only worked in Internet Explorer 3.02 and higher, and several clients used Netscape, so I had to find another solution.
....Read More |
Rating
|
|