Here is an example:
Dim WithEvents http As Chilkat.Http
Private Sub http_OnPercentDone(ByVal sender As Object, ByVal args As Chilkat.PercentDoneEventArgs) Handles http.OnPercentDone
ProgressBar1.Value = args.PercentDone
End Sub
Private Sub HttpDownloadTest()
http = New Chilkat.Http()
Dim success As Boolean
' Any string unlocks the component for the 1st 30-days.
success = http.UnlockComponent("Anything for 30-day trial")
If (success <> True) Then
MsgBox(http.LastErrorText)
Exit Sub
End If
‘ Enable event callbacks…
http.EnableEvents = True
‘ Download the Python language install.
‘ Note: This URL may have changed since this example was created.
success = http.Download(”http://www.python.org/ftp/python/2.5/python-2.5.msi”, “python-2.5.msi”)
If (success <> True) Then
MsgBox(http.LastErrorText)
Else
MsgBox(”Python Download Complete!”)
End If
http = Nothing
End Sub
Chilkat methods that return date/time information do so using SYSTEMTIME. The reason is that Chilkat’s C++ API uses SYSTEMTIME (a MS Windows struct for holding date/time information) and these are wrapped to produce the Java (JNI) API.
Here is an example showing how to access the contents of SYSTEMTIME:
CkEmail email = new CkEmail();
SYSTEMTIME dt = new SYSTEMTIME();
email.get_LocalDate(dt);
int month = dt.getWMonth();
int year = dt.getWYear();
int day = dt.getWDay();
int hour = dt.getWHour();
int minute = dt.getWMinute();
int second = dt.getWSecond();
If you pass a filename with no path to the SFTP OpenFile method, and the SFTP server is WS_FTP, you may get a “Folder not found” error.
An SFTP server *should* open or create the file in the home directory of the logged-in account. This doesn’t seem to be the case with the WS_FTP server. The fix is to call RealPath(”.”,”") to get the absolute path of the logged-in account, and then combine this with the filename and pass it to OpenFile.
For example, if trying to OpenFile(”helloWorld.txt”)
and RealPath(”.”,”") returns “/chilkat”,
then do this: OpenFile(”/chilkat/helloWorld.txt”)
Recently, the ESET NOD32 AntiVirus program began erroneously detecting the Chilkat .NET 2.0/3.5 download as containing a Genetik Trojan virus. This is incorrect (i.e. it is a false positive). After researching the Genetik Trojan, it has become apparent that NOD32’s virus definition for this particular virus is frequently a false-positive. If you experience this problem, report the false-positive by sending email to samples@eset.com.
NOTE: The problem only occurs during the download. The ChilkatDotNet2.dll, once on your system, is not detected as a virus. Therefore, you may bypass the problem by downloading the Chilkat .NET assembly from this encrypted .zip:
http://www.chilkatsoft.com/download/ChilkatDotNet2_enc.zip
The password is “chilkatsoft”.
Unzip and place the ChilkatDotNet2.dll in your app’s bin directory. In Visual Studio, add a reference to this assembly by browsing to the DLL’s location and selecting the DLL.
Question:
"When using Chilkat .NET from an SSIS script, make sure the
ChilkatDotNet2.dll assembly is stored in the GAC (Global Assembly
Cache). This is required to allow the .NET runtime to find and load
the assembly."
However, when I try to add a reference to ChilkatDotNet2.dll it does
not show up on the list of available dll's. Do you have any experience
with this problem? Any way you can help me get over this hurdle?
Answer:
Inside of SSIS there is no tab to browse. The interface is a little
simpler than the one for traditional .Net apps.
FYI...
I just discovered this. I also had to add the DLL to the .NET Framework
folder: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Now it shows up on the list!
This error can happen when trying to transfer a file or list a directory in Active (PORT) mode. The problem is usually solved by switching to Passive mode. Set the Ftp2.Passive property equal to True.
Explanation of the problem: In Active mode, the data connection is setup like this: The client sends a PORT command telling the server the port where it will be listening for the data connection. The server receives the PORT command and initiates a connection to the client’s IP/port. However, if a firewall is blocking the incoming connection, then it will go unanswered, and the server will timeout waiting for the connection to be accepted.
This error message is usually an indication that the VC++ runtime is missing on a system.
Downloading and installing the Microsoft VC++ runtime that matches the version you need will fix this problem. To find the redistributable at microsoft.com, Google using this search string “visual c++ redistributable 2005″. Substitute “2008″, “2002″, or “2003″ for different versions…
For example, one recent Chilkat customer had this error message in Java:
java.lang.UnsatisfiedLinkError: C:\temp\new\chilkat.dll: This
application has failed to start because the application
configuration is incorrect. Reinstalling the application may fix this problem
The Chilkat modules/libs for Java, Perl, Python, and Ruby are compiled using Visual C++ 2005 (not SP1), so you would need the runtime for that version (i.e. VC++ 8.0).
This note applies to the instantiation of ActiveX components (not .NET assemblies).
If a call to CreateObject (VBScript) or Server.CreateObject (ASP) or sp_OACreate (SQL) fails with the following errors:
Invalid class string
Invalid ProgID
It indicates that the ActiveX has not been registered via regsvr32 on the computer, or the registry permissions on the ProgID key prevent the object from being created.
To register, open a MS-DOS command prompt and type:
c:\> regsvr32 c:\path\ChilkatSomething.dll
Where “ChilkatSomething.dll” is the filename of a Chilkat ActiveX DLL.
The DLL may be located in any directory. (It does not need to be placed in Windows\system32.) The important point is that once registered, the DLL’s physical location should not be changed.
This error might also be the result of insufficient permissions for the ProgID registry key. If you know the component has been registered via regsvr32, run regedt32 and check the permissions on the HKEY_CLASSES_ROOT\ProgID, where ProgID is a string such as “Chilkat.Ftp2″ or “Chilkat.Ssh”. The full set of ProgID’s may be found here: Chilkat ProgID’s for CreateObject Open the registry key, select Permissions from the Edit menu and grant the “Everyone” account full control.
I found this PDF somewhere on Microsoft’s site, but now I cannot find it anymore. Therefore, I uploaded it to here: http://www.cknotes.com/microsoft-certificate-support.pdf
This contains a collection of how-to procedures for certificates:
- Install certificate after deleting the pending certificate request (IIS 6.0)
- Installing Server Certificates (IIS 6.0)
- How to install a certificate for use with IP Security in Windows Server 2003
- Key Archival and Management in Windows Server 2003
- Renew a certificate with the same key
- Renew a certificate with a new key
- How To Renew or Create New Certificate Signing Request While Another Certificate Is Currently Installed
- Request a certificate using a PKCS #10 or PKCS #7 file
- Renew a root certification authority
- Importing and exporting certificates
- Trusted root certification authority policy
- Object IDs Associated with Microsoft Cryptography
- Certutil tasks for backing up and restoring certificates