Wednesday, November 25, 2009

DHTML Wonders

We can do a lot of things using DHTML
follow the below url for wonderful code and demos

http://www.dhtmlgoodies.com/

Tuesday, November 24, 2009

IFrames and cross-domain communication

Wow..We can communicate with different domains which are in same page using javascript


Click on the following URL for solution
http://pipwerks.com/2008/11/30/iframes-and-cross-domain-security-part-2/

Monday, November 23, 2009

JavaScript list of Files in Folder

var folderspec="C:\\msa"
var fso, f, f1, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.files);
s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.item();
s += "
";

}
document.write(s);

Change the Status of a Control in Threading

public static void SetBtnStatus(bool status, Button btn_Status)
{
if (btn_Status.InvokeRequired)
{
btn_Status.BeginInvoke(
new MethodInvoker(
delegate() { SetBtnStatus(status, btn_Status); }));
}
else
{
btn_Status.Enabled = status;
}
}

ViewSource of an URL

using System.Net;


public string getURLSource(string strUrl)
{
WebClient webClient = new WebClient();
byte[] reqHTML;
reqHTML = webClient.DownloadData(strUrl);
UTF8Encoding objUTF8 = new UTF8Encoding();
string str = objUTF8.GetString(reqHTML);
return str;
}