November 26, 2008

Controlling Checkboxes in MFC

Here’s how to check, uncheck, enable, and disable a checkbox in MFC: CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM); pBtn-&gtSetCheck(0);// uncheck it CButton* pBtn = (CButton*) GetDlgItem(IDC_SETUP_AM); pBtn->SetCheck(1);// check it CButton* pBtn

Upload Large Files

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.

Authenticate to a Proxy Server

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);