How to set session timeout in web.config
If you want to set the timeout to 20 minutes, use something like this:
If you want to set the timeout to 20 minutes, use something like this:
Note: The cast to (Suit[]) is not strictly necessary, but it does make the code 0.5 ns faster.
I don’t understand where the first “result with sample data” is coming from, but the problem in the console app is that you’re using SelectMany to look at each item in each group. I think you just want: The use of First() here to get the product name assumes that every product with the same product code has the same … Read more
Whenever you use SingleOrDefault, you clearly state that the query should result in at most a single result. On the other hand, when FirstOrDefault is used, the query can return any amount of results but you state that you only want the first one. I personally find the semantics very different and using the appropriate one, depending on the expected … Read more
The RFC is just trying to say that a signed integer is a normal 4-byte integer with bytes ordered in a big-endian way. Now, you are most probably working on a little-endian machine and BitConverter.GetBytes() will give you the byte[] reversed. So you could try: For the code to be most portable, however, you can do it like this:
could it create problem to install the same certificate on several systems? No, it will not be a problem even if the systems would be connected to the internet in the future. When you connect the system to the internet and do the update it could download a pack of trusted certificates. These certificates will … Read more
You can either use a double backslash each time or use the @ symbol
I seem to be having some trouble wrapping my head around the idea of a Generic List of Generic Lists in C#. I think the problem stems form the use of the <T> argument, which I have no prior experience playing with. Could someone provide a short example of declaring a class which is a … Read more
How can I encrypt and decrypt a string in C#?
If you’re on .NET 3.5, you can use the following IEnumerable coolness: Edit: and here’s the corresponding VB.NET code: Second edit, in response to remarks that System.Random “isn’t threadsafe” and “only suitable for toy apps” due to returning a time-based sequence: as used in my example, Random() is perfectly thread-safe, unless you’re allowing the routine … Read more