Pages

Sunday, June 15, 2008

Best Working Serials

1) Microsoft Expression Studio 2:

GFF4B-G4JJ8-HXRPX-RV4VQ-8CV9W

2) Microsoft Office 2007 Enterprise:

XVGKM-9J9D4-M8VJT-VC694-TY6HW

3) Microsoft Windows XP Professional:

V2C47-MK7JD-3R89F-D2KXW-VPK3J

4) Nero 7

1C80-0014-19E5-MA2X-400E-8M09-2X09

Saturday, May 31, 2008

User Confirmation before Deleting Items in ASP.Net 2.0

Attach the OnClientClick event to the button as below

asp:button id="btnapprove" tabindex="65" runat="server" cssclass="buttonstyle" text="Update Status" onclientclick="return confirm('Are you sure you want to delete this Contact Record?');"

Tuesday, May 13, 2008

JavaScript for Filter Action in FileUpload Control

function Trim(input)
{
var lre = /^\s*/;
var rre = /\s*$/;
input = input.replace(lre, "");
input = input.replace(rre, "");
return input;
}
function CheckForImageFile()
{
var file = document.getElementById('<%=uploadLogo.ClientID%>');
var fileName=file.value;
var extArray = new Array(".jpg", ".JPG", ".gif", ".GIF", ".png", ".PNG",
".bmp", ".BMP", ".jpeg", ".JPEG","");
while (fileName.indexOf("\\") != -1)
fileName = fileName.slice(fileName.indexOf("\\") + 1);
var ext = fileName.slice(fileName.indexOf(".")).toLowerCase();
for (var i = 0; i < extArray.length; i++)
{
if (extArray[i] == ext)
{
return true;
}
}
alert("Please only upload images that end in types: "
+ (extArray.join(" ")) + "\nPlease select a new "
+ "image to upload and submit again.");
file.focus();
return false;
}

Wednesday, April 9, 2008

Multiple Login in Yahoo Messenger

Multiple login in yahoo without using any Software
You can login with multiple id's on the
same yahoo messenger without any download or patch .
Follow these steps :
1. Go to Start ----> Run .
Type regedit, then enter .
2.Navigate to
HKEY_CURRENT_USER
--------> Software
--->yahoo
----->pager
---->Test
3.On the right page , right-click and
choose new Dword value .
4.Rename it as Plural.
5.Double click and assign a decimal value of 1.
Its done!!Now close registry and
restart yahoo messenger and try Multiple Login

Wednesday, March 5, 2008

Multiple file upload in ASP.NET

Saving files temporarily in the application folder and displaying in a Gridview

Protected Sub btnattachsiteplan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnattachsiteplan.Click
Dim usersession As myApp.UserSession
usersession = Session("UserSession")
lbluploadsiteplan.Text = ""
Dim uname As String = usersession.UserName
Dim path As String = "temp\Siteplan\" + uname + "\"
Dim appPath As String = Request.PhysicalApplicationPath
If FileUpload2.HasFile Then
If Not Directory.Exists(appPath + path) Then
Directory.CreateDirectory(appPath + path)
End If
Dim savePath As String = appPath + path + Server.HtmlEncode(FileUpload2.FileName)
FileUpload2.SaveAs(savePath)
Dim dt As DataTable = New DataTable
dt.Rows.Clear()
dt.Columns.Add("Attachment", GetType(String))
Dim dr As DataRow
dr = dt.NewRow
dr("Attachment") = FileUpload2.PostedFile.FileName
dt.Rows.Add(dr)
GridView2.DataSource = dt
GridView2.DataBind()
dt.Rows.Clear()
lbluploadsiteplan.Text = "File Attached"
Else
lbluploadsiteplan.Text = "Browse a File and then Click Attach"
End If
End Sub

Deleting uploaded files from the temporary folder

Protected Sub btndeletesiteplan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndeletesiteplan.Click
lbluploadsiteplan.Text = ""
Dim usersession As myApp.UserSession
userSession = Session("UserSession")
Dim uname As String = userSession.UserName
Try
Dim path1 As String = Server.MapPath("~\temp\Siteplan\" + uname)
If Directory.Exists(path1) Then
Dim s As String
For Each s In System.IO.Directory.GetFiles(path1)
System.IO.File.Delete(s)
Next s
End If
lbluploadsiteplan.Text = "Files Deleted"
Dim dt As DataTable = New DataTable
GridView2.DataSource = dt
GridView2.DataBind()

Catch
lbluploadsiteplan.Text = "Select a File and then Click Delete"
End Try
End Sub

Saving files from the temporary folder

Protected Sub SaveFilesFromTemporaryFolder
Dim uname as myApp.UserSession.UserName
Try
Dim path1 As String = Server.MapPath("~/temp/ExtraPages/" + uname + "/")
Dim path2 As String = Server.MapPath("~/Uploads/ExtraPages/" + maxcrplankey.ToString() + "/")
If Not Directory.Exists(path2) Then
Directory.CreateDirectory(path2)
End If
Dim diSource As DirectoryInfo = New DirectoryInfo(path1)
Dim diTarget As DirectoryInfo = New DirectoryInfo(path2)

For Each fi As FileInfo In diSource.GetFiles()

fi.CopyTo(Path.Combine(diTarget.ToString(), fi.Name), True)
fi.Delete()
Next
lbluploadpage.Text = ""
Catch
End Try

Try
Dim path3 As String = Server.MapPath("~/temp/Siteplan/" + uname + "/")
Dim path4 As String = Server.MapPath("~/Uploads/Siteplan/" + maxcrplankey.ToString() + "/")
If Not Directory.Exists(path4) Then
Directory.CreateDirectory(path4)
End If
Dim diSource1 As DirectoryInfo = New DirectoryInfo(path3)
Dim diTarget1 As DirectoryInfo = New DirectoryInfo(path4)

For Each fi As FileInfo In diSource1.GetFiles()

fi.CopyTo(Path.Combine(diTarget1.ToString(), fi.Name), True)
fi.Delete()
Next
lbluploadsiteplan.Text = ""
Catch
End Try
End Sub

Send emails from Dotnet applications

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
namespace ie.app
{
///
/// Summary description for SendMails
///

public class SendMails
{
public SendMails()
{
//
// TODO: Add constructor logic here
//
}
public static void sendEmailMessage(string subject, string toAddress, string body)
{
string fromAddress = ConfigurationManager.AppSettings.Get("fromaddress");
MailMessage mm = new MailMessage(fromAddress, toAddress);

mm.Subject = subject;
mm.Body = body;
mm.IsBodyHtml = false;

SmtpClient smtp = new SmtpClient();

smtp.Send(mm);
}
}
}