Archive : C#

RSS feed
get machine name and ip address C#

get machine name and ip address C#

be sure to use the following namespace using System.Net; we will create a method that sends out machine name and ip address as output parameters void getMachineInfo(out string MachineName, out string IPAddress) { MachineName= Dns.GetHostName(); IPHostEntry iphostentry = Dns.GetHostByName(MachineName); IPAddress = iphostentry.AddressList[0].ToString(); } you wanna call the method like : string [...]
Gradient Datagridview Columns Header C#

Gradient Datagridview Columns Header C#

Unfortunately datagridview does not support gradient columns header , there’s a work around it : first thing we need to do is to handle the CellPainting Event of the Datagridview . put this segment of code on the top of code page of the Form //to use brushes , and graphics using System.Drawing; using System.Drawing.Drawing2D; in the CellPainting Event of the datagridview post the following [...]
ADO.Net Connection Class

ADO.Net Connection Class

Introduction .. in order to connect to any data source you will often need some information about that source , such as it’s location and it’s way of connectivity . also you will be needing a tool to connect and disconnect from that data source ADO.Net Connection Class .. ADO.Net encapsulate all of the data source connectivity in one class called  ”Connection” , according [...]
Hashing a Passwords using MD5 & SHA1

Hashing a Passwords using MD5 & SHA1

Instead of saving passwords in a plain text format in the database it’s better hashing them one thing to consider is hashing is not encrypting which means once you hashed the password you will never see the original one (theoretically) for example if you hash the word “Pharaoh”  using MD5 you will get “……………..” now all we need to do is to [...]
Manual Paging ASP.Net GridView

Manual Paging ASP.Net GridView

Introduction … ! using SqlDataSource With the GridView Control gives you a lot of advantages , on the other hand if you are an old school ADO/ADO.Net programmer you would encounter scenarios where you wanna bind your gridview with your own datatable . the most obvious problem you will encounter that after binding the datatable with gridview and set AllowPaging = true and try to navigate between [...]
Ternary Operators C#

Ternary Operators C#

Ternary Operators …. Basically ternary operators are just an inline if statements .. Consider the following  Pseudo code segment bool isAdmin = getUserStatus(); string outPutMessage = ""; if (isAdmin) { outPutMessage =  "You Are An Administrator"; } else { outPutMessage =  "You Are A Normal User"; } MessageBox.Show(outPutMessage); Assuming that getUserStatus() is a Method that returns a boolean [...]
ADO.Net Introduction

ADO.Net Introduction

Introduction .. As a Developer it’s one of my daily tasks to perform database operations such as read data from database and update data back to the database and handle all sorts of data manipulation operations such as searching and exporting sets of data into another formats , etc . What’s ADO.Net .. ? ADO.Net is a rich set of Classes Provided Within Microsoft’s .Net to Handle [...]
© 2010 Programming online. All rights reserved.
Premium WordPress Themes
freshlife WordPress Themes Theme Junkie