I was doing a log in mechanism on project where i required Encryption and Decryption code
Here is the simplest method i found:
private string Encryptdata(string password)
{
string strmsg = string.Empty;
byte[] encode = new byte[password.Length];
encode = Encoding.UTF8.GetBytes(password);
strmsg = Convert.ToBase64String(encode);
return strmsg;
}
private string Decryptdata(string encryptpwd)
{
string decryptpwd = string.Empty;
UTF8Encoding encodepwd = new UTF8Encoding();
Decoder Decode = encodepwd.GetDecoder();
byte[] todecode_byte = Convert.FromBase64String(encryptpwd);
int charCount = Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
char[] decoded_char = new char[charCount];
Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
decryptpwd = new String(decoded_char);
return decryptpwd;
}
Original Source : http://www.aspdotnet-suresh.com/2010/12/introduction-here-i-will-explain-how-to_28.html
Thursday, 28 August 2014
Wednesday, 27 August 2014
Binding / concatenating a string literal with eval
Recently i have a requirement where i have to bind an anchor tag with two parameters in repeater. I have search for few time and then one of my friend suggest me the following solution
<a href='<%#string.Concat(siteURL,Convert.ToString(DataBinder.Eval(Container.DataItem,"TargetURL"))) %>'
<%# Container.ItemIndex==0?"class=\"fc\"":string.Empty %>><%#DataBinder.Eval(Container.DataItem,"Title") %>
</a>
<a href='<%#string.Concat(siteURL,Convert.ToString(DataBinder.Eval(Container.DataItem,"TargetURL"))) %>'
<%# Container.ItemIndex==0?"class=\"fc\"":string.Empty %>><%#DataBinder.Eval(Container.DataItem,"Title") %>
</a>
Thursday, 10 April 2014
Calculated Column DateTime to date Convert
I was recently working with Calculated Column and i face a horrible nightmare type issue. I just need to copy date-time column value to a date type column. But it takes at least 3 to 4 hours of mine. Then I found this. I forget to get link but I get this much info which i want to share with you.
=IF(TEXT(([End Time]-[Start Time])-TRUNC(([End Time]-[Start Time]),0),"0.000000000")="0.999305556",[Start Time]+1,[Start Time])Basically, the formula checks whether the event is an all day event and if so increases the value by whatever you need. It determines whether the event is all day by checking the difference between the end time and smart time (12:00am to 11:59pm).
Here's the formula as I used it:
=IF(TEXT(([End Time]-[Start Time])-TRUNC(([End Time]-[Start Time]),0),"0.000000000")="0.999305556",[Start Time]+1,[Start Time])
So, get the difference between end time and start time, then subtract the truncated value of the same value (get rid of the value to the left of the decimal which would indicate that the all day event spans multiple days). If the difference is .999305556 then I'm adding 1 day to the value of start time (since I'm only interested in showing the date, not the time), otherwise leave the date/time as is.
Hope that helps someone else with calculated date columns.
Wednesday, 9 April 2014
Hide/Show Result window
I have this question from long time in my mind. Whenever i run query in SQL result window acquire half the space.look at the figure.
I generally decrease the size of the result window and continue to work on. Now I get the solution. Just Press Ctrl + R and it hide. press it again and it shows up. I hope this shortcut will be useful to you too.
Crop In Paint
Generally I used to editing image in paint . So i just wanna saw how a functionality named crop make my work easy.
Long way
1. open image and select the part
2. Copy or cut the part
3. open new file
4. paste
5. save
shortcut using crop
1. open image and select the part
2. click the crop
3. save
That's simple one but very useful when doing documentation for your project.
How to remove Security warning when using https.
Recently I was working on a project which uses the HTTPS for URL.I face a unique problem in that some of my pages contents are not fully loaded in the browser like model popup.
So I took some steps to avoid this problem.
1. go to internet options.
2. open security tab and click on custom tab.
3. slide down till option "Display Mixed content".
4. change it to "Enable" and save the changes.
5. refresh the page.
Note: I prefer to work with IE. This solution figures are from IE11.
Tuesday, 8 April 2014
SQL StoreProcedure Change Report Generate
To Create SQL Procedure Change Report
1. Select your Database Store procedure folder Your database -> Programmability -> Store Procedure 2.In ribbon , View-> Object Explorer Details or press F7 (as Shown in figure)
That's it. You will See the Report. To check when modification has done Select the Date Last Modified column as shown in fig.
Sunday, 16 March 2014
SharePoint Introduction
What Is SharePoint?
Microsoft SharePoint is a Web application platform developed by Microsoft to provide intranet portals, document & file management, collaboration, social networks, extranets, websites, enterprise search, and business intelligence. It also has system integration, process integration, and workflow automation capabilities.
Means Its a Platform To develop SharePoint Based websites. All the other things are functionalists (such as document & file management, workflow etc.) or type (like enterprise search) of those websites.
So how would we start? Lets start by installing SharePoint. Here is some links where you can download free or trial version for installation.
Microsoft SharePoint Server 2010 Trial version for 180 days- 560.5 MB
Subscribe to:
Posts (Atom)
SharePoint Classic Site Retirement: Your Plan to Avoid Last-Minute Chaos
Classic SharePoint has been on borrowed time for years. Microsoft has now put dates on the remaining pieces. Microsoft will disable creation...
-
In last blog we learn how can we enable footer on SharePoint Online Modern Communication site. If you have not gone through that you can use...
-
If you're managing SharePoint Online environments, there's a significant change on the horizon that you need to prepare for. Microso...
-
Issue : Recently, we had a requirement to sync the calendar between shared mailbox outlook and SharePoint Calendar list. We have created 2 f...















