Encode and Decode URLs Using UTF-8
This tip shows you how to encode and decode your URLs using the UTF-8 character encoding: import java.net.*;public class URL_Encoder_Decoder{ public static void main(String[] args){ String url = “@sir de
This tip shows you how to encode and decode your URLs using the UTF-8 character encoding: import java.net.*;public class URL_Encoder_Decoder{ public static void main(String[] args){ String url = “@sir de
Use the following C# 2.0 code to determine whether a string representation of date/time is valid: string s=”04/01/2008″; //string to be converted to date time object.DateTime result;bool success = DateTime.TryParse(s,
This tip shows you how to call a SOCKS proxy server from Java code using the Socket class: SocketAddress addr=new InetSocketAddress(?socks_server_proxy?, socks_port);Proxy proxy=new Proxy(Proxy.Type.SOCKS,addr);Socket socket=new Socket(proxy);InetSocketAddress final_addr=new InetSocketAddress(?final_server?, final_port);socket.connect(final_addr);?
In SQL Server Management Studio, you can use the Alt key in your keyboard to select blocks of text to execute. For instance, suppose you have the following statements: –@DELETE
By default, ASP.NET doesn’t allow you to upload files bigger than 4MB to the server. You can fix this by overriding the default value of 4MB in the web.config file.
Here’s how to check, uncheck, enable, and disable a checkbox in MFC: CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM); pBtn->SetCheck(0);// uncheck it CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM); pBtn->SetCheck(1);// check it CButton* pBtn
To provide a user’s password to a proxy server, use the following code: URLConnection URLcon=null;URLcon = url.openConnection();byte[] x=”name:password”.getBytes();//coding in Base64String s = new sun.misc.BASE64Encoder().encode(x); URLcon.setRequestProperty( “Proxy-Authorization”,s);
Regional settings, especially dates, are always a problem in code. For example, suppose the product is developed in U.S. and deployed in UK. Users entering dates in UK format would
Most applications nowadays authenticate through LDAP (directory service). To set this up, first register the SSL certificate using the keytool utility, as shown below: Register ssl certificate using keytool:keytool -import