ZXTM Control API Overview and Reference
Version 4.0
2.1.2 C#
Example
using System;
using System.Net;
using System.IO;
using System.Security.Cryptography.X509Certificates;
public class AllowSelfSignedCerts : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint sp, X509Certificate cert,
WebRequest request, int problem )
{ return true; }
}
public class addBannedAddress {
public static void Main( string [] args )
{
System.Net.ServicePointManager.CertificatePolicy =
new AllowSelfSignedCerts();
string url= "https://host:9090/soap";
string username = "username";
string password = "password";
string name = "My protection class";
string badIP = "10.100.1.10";
try {
ZXTM.CatalogProtection p =
new ZXTM.CatalogProtection();
p.Url = url;
p.Credentials = new NetworkCredential(
username, password );
p.addBannedAddresses( new string[] { name },
new string[][] { new string[]{ badIP } } );
} catch ( Exception e ) {
Console.WriteLine( "{0}", e );
}
}
}
32
New Page 1