Upto .NET Framework 4.5 we cannot create .zip files. In .NET Framework 4.5
it is now possible. Following is example for creating zip file and extracting zip file
from and to folder.

Async and Await keywords used for asynchronous programming in C#.

There are times when being able to limit the pattern matching duration of Regex operations could be useful, especially when working with user supplied patterns to match data.
The MatchTimeout property defines the approximate maximum time interval for a Regex instance to execute a single matching operation before the operation times out. The regular expression engine throws a RegexMatchTimeoutException exception during its next timing check after the time-out interval has elapsed. This prevents the regular expression engine from processing input strings that require excessive backtracking. 
This property is read-only. You can set its value explicitly for an individual Regex object by calling the Regex.Regex(String, RegexOptions, TimeSpan) constructor; and you can set its value for all Regex matching operations in an application domain by calling the AppDomain.SetData method and providing a value for the 
“REGEX_DEFAULT_MATCH_TIMEOUT” property. If you do not explicitly set a timeout interval, the default value Regex.InfiniteMatchTimeout is used, and matching operations do not time out.

We can achieve this using CustomReflectionContext class. provides a way for you to add or remove custom attributes from reflection objects, or add dummy properties to those objects, without re-implementing the complete reflection model. The default CustomReflectionContext simply wraps reflection objects without making any changes, but by subclassing and overriding the relevant methods, you can add, remove, or change the attributes that apply to any reflected parameter or member, or add new properties to a eflected type.

Inside the application domain when threads get created, threads gets default culture from windows initialized from the system default locale as configured in control panel > region and language settings. But with .NET Framework 4.5 it is possible to provide default culture for an application domain using DefaultThreadCurrentCulture and CurrentUICulture properties of CultureInfo class.

By default, the StringComparer class and the string.GetHashCode method use a single hashing algorithm that produces a consistent hash code across application domains. This is equivalent to setting the enabled attribute of the element to 0. This is the hashing algorithm used in the .NET Framework 4. The StringComparer class and the String.GetHashCode method can also use a different hashing algorithm that computes hash codes on a per application domain basis. As a result, hash codes for equivalent strings will differ across application domains. This is an opt-in feature; to take advantage of it, you must set the enabled attribute of the element to 1.

Sometimes, we required to show all items in Gridview or repeater but we do not want to implement paging. In this case, a scrolling grid is more applicable and enclosing the GridView in a Panel control or <div> tag with the overflow style applied ensures that the over-sized element is clipped and that scroll bars are displayed.
This solution works fine but whenever a postback occurs on page the div gets back to its original starting position. Here in this example, In order to maintain the scrolled position after postback I stored the div scroll value in hiddenfield using jquery and after postback we can get the scroll value from hiddenfield and set back to div to maintain the scroll position after asynchronous postback.

Need Help? Contact Us.

Log in


Forgot password?


New User