Is so easy to create a random string on ASP .Net with/without as of ASP .Net 2 with just the following code:
int length = 50;
int numberOfNonAlphanumericCharacters = 0
srtring random = Membership.GeneratePassword(length , numberOfNonAlphanumericCharacters);
Create an application that will be able to replace an array of words and replace them with an array of corresponding words on an MS Word document.
Recently I was instructed to create an application that will be able to replace an array of words and replace them with an array of corresponding words on an MS Word document. With this I’ve searched the following:
- Visual Stduio
- Install the nuget package DocX
- Administrative access on the context the application is running
Dictionary<string, string> lReplacements = new Dictionary<string, string>();
string newFullPath = @”c:\sample.docx”;
using (DocX document = DocX.Load(newFullPath))
//for loop is better than foreach
foreach (var item in lReplacements)
Hope it helped you as it helped me with this simple snippet.
Have ever wondering on how can you handle a Single Login Per User on your website? Yes may be you will need to disable multiple login due to some security reasons.
Have ever wondering on how can you handle a Single Login Per User on your website? Yes may be you will need to disable multiple login due to some security reasons. So here is the only perfect way that you can do it:
- When the user login flag on the database either an IP(for single login on a network) or Session Id of the user (for single login across all network).
- Then every time the user visit a page in your website check if the flag has been change.
- If the flag has been change then log off the current user
That way you can manage only one login per account depending on what situation you want it to happen. If you are thinking that you don’t want to logoff the current user but disable other login that will be impossible to happen. Because you can’t stop a user from closing the browser or shutting down the computer. In such cases you can’t handle on your script.