ASP.NET 5 is the next version of ASP.NET that enables developers to build using the modern framework for web and cloud scenarios. It contains the SignalR, MVC, Web API and Web Pages. ASP.NET 5 is a high-performance and modular design.…

ASP.NET 5 is the next version of ASP.NET that enables developers to build using the modern framework for web and cloud scenarios. It contains the SignalR, MVC, Web API and Web Pages. ASP.NET 5 is a high-performance and modular design.…
This article explains the Ajax Tab Container extender and how to use it in ASP.NET. The TabContainer is an AJAX Control to create a set of Tabs to organize the contents of an ASP.Net page. It is uesd to host…
Learn step by step how to publish an MVC application without using Visual Web Developer Publish Your Application Without Using Visual Web Developer An ASP.NET MVC application can be published to a remote server by using the Publish commands in…
To begin with, want to claim that in the developed by default ASP.NET MVC 4.5 software we currently have capacity for merely enabling of integration with variations social networking sites. Let’s create not vacant ASP.NET MVC 4.5 software, and enable…
ASP.NET MVC is very popular now a day. But we have much legacy system of ASP.NET web form. If you want to use ASP.NET MVC with legacy ASP.NET web form application. What should you do? This is not encouraged to…
Download Wingtip Toys Sample Project (C#) This step-by-step tutorial series will teach you the basics of building an ASP.NET Web Forms application using ASP.NET 4.5 and Microsoft Visual Studio Express 2013 for Web. Introduction This series of tutorials guides you…
WebSockets is a good neat function. Numerous server-side implementations exist, this sort of as SignalR and Socket.IO. The .NET 4.5 now provides developers a managed implementation of the WebSockets protocol. Following a quick introduction on WebSockets, without likely to the…
Now, we will discuss about How to Use Rangevalidator control in ASP.NET 4.5. Rangevalidator control is used to check if the value is within a specified range of values. For example, Rangevalidator can be used to check if the age…
In this tutorial, I will show you How to Encrypt and Decrypt string in ASP.NET 4.5. The code below show the way. It needs 2 references to include:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
using System.Text; using System.Security.Cryptography; public static string Encrypt(string toEncrypt, bool useHashing) { byte[] keyArray; byte[] toEncryptArray = UTF8Encoding.UTF8.GetBytes(toEncrypt); string key = "MySeCrEtKeY"; if (useHashing) { MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); hashmd5.Clear(); } else keyArray = UTF8Encoding.UTF8.GetBytes(key); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tdes.Key = keyArray; tdes.Mode = CipherMode.ECB; tdes.Padding = PaddingMode.PKCS7; ICryptoTransform cTransform = tdes.CreateEncryptor(); byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); tdes.Clear(); return Convert.ToBase64String(resultArray, 0, resultArray.Length); } public static string Decrypt(string cipherString, bool useHashing) { byte[] keyArray; byte[] toEncryptArray = Convert.FromBase64String(cipherString); string key = " MySeCrEtKeY"; if (useHashing) { MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); hashmd5.Clear(); } Else keyArray = UTF8Encoding.UTF8.GetBytes(key); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tdes.Key = keyArray; tdes.Mode = CipherMode.ECB; tdes.Padding = PaddingMode.PKCS7; ICryptoTransform cTransform = tdes.CreateDecryptor(); byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length); tdes.Clear(); return UTF8Encoding.UTF8.GetString(resultArray); } |
Hope it works out!
In it we details out a few gotchas which can be SO common when folks try to do function in the background. Go through it, but here is a summary from his post. An unhandled exception in a thread not…