Tuesday, May 15, 2007

Delete File If Exists Else Create

This Porgarm will delete a file with name Test.txt if exists in the Root Dir, else create a new file with name Test.txt with in the Root dir.FileInfo and File both the classes are available in System.IO namespace.

FileInfo Class
Provides instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. This class cannot be inherited.

File Class
Provides static methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects.



Program

protected void btCreate_Click(object sender, EventArgs e)
{
try
{
FileInfo TheFile = new FileInfo(MapPath(".") + "\\" + "Test.txt");
if (TheFile.Exists)
{
File.Delete(MapPath(".") + "\\" + "Test.txt");
}
else
{
File.Create(Server.MapPath(".") + "\\" + "Test.txt");
}
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}

Saturday, May 12, 2007

CSS Compressor



CSS Compressor
    Use this utility to compress your CSS to increase

loading speed and save on bandwidth as well. You can

choose from three levels of compression, depending on

how legible you want the compressed CSS to be versus

degree of compression.The "Normal" mode should work

well in most cases, creating a good balance between

the two.

Try Google Suggest And Feel The Difference



Try Google Suggest And Feel The Difference

Wednesday, May 9, 2007

Palindrome

private void btCheck_Click(object sender, System.EventArgs e)
{
char[] Temp = TextBox1.Text.ToCharArray();
Array.Reverse(Temp);
string str = new String(Temp);
if(str == TextBox1.Text)
{
Response.Write(@"<script>alert('Palindrome')</script>");
}
else
{
Response.Write(@"<script>alert('!Palindrome')</script>");
}
}

Wednesday, May 2, 2007

Silverlight

 Microsoft Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of .NET-based media experiences and rich interactive applications for the Web. Silverlight offers a flexible and consistent programming model that supports AJAX, Python, Ruby, and .NET languages such as Visual Basic and C#, and integrates with existing Web applications. Silverlight media capabilities include fast, cost-effective delivery of high-quality audio and video to all major browsers including Firefox, Safari, and Internet Explorer running on Mac or Windows. By using Expression Studio and Visual Studio, designers and developers can collaborate more effectively using the skills they have today to light up the Web of tomorrow.
For More Info

Microsoft® Silverlight™ 1.0 Beta Software Development Kit (SDK)  

Microsoft® Silverlight™ 1.1 Alpha Software Development Kit (SDK) 
 


Microsoft® Silverlight™ 1.1 Alpha Developer Reference Poster