Posts

Showing posts from January, 2012

Add SpacesTo Sentence in C#

 public string AddSpacesToSentence(string text)     {         if (string.IsNullOrEmpty(text))             return "";         StringBuilder newText = new StringBuilder(text.Length * 2);         newText.Append(text[0]);         for (int i = 1; i < text.Length; i++)         {             if (char.IsUpper(text[i]))                 newText.Append(' ');             newText.Append(text[i]);         }         return newText.ToString();     }

Encryption and Decryption in c#

Encryption and Decryption in c# 1)Create new class named as Serialization inside it create two new function copied following code to that class. 2)Passes  value in the query string and call the method Encryptnew to Encript the value.     Ex:-          Response.Redirect("Querytest.aspx?val="+ClassName.Seralize.EncryptNew(txtname.Text)); 3)Decrypte the value which is getting from query string....     Ex:-         Label lblresult = new Label();             lblresult.Text = BAL_Yahoo.Seralize.DecryptNew(Request.QueryString["val"].ToString());             form1.Controls.Add(lblresult); This code is very very important for Encrypte and decrypte values in the C#......... Used in online banking site and social network site to security perpouse. public static string EncryptNew(...

Java script for accept only numbers

  function fnCheckIntegerValue(e, o) {             var vTxtVal = o.value;             var sTst = false;             evt = e || window.event;             var keyPressed = evt.which || evt.keyCode;             if (keyPressed < 58 && keyPressed > 47) {                 sTst = true;             }             else {                 //o.value = vTxtVal;               ...