.net

How do I find out which method is more CPU-intensive?

There are several implementations of MD5, for example. Finding out which method is faster is not a problem. How to correctly find out which of these methods gives a greater load on the processor?

Mongo mock collection

I'm trying to "lock" MongoDB. In the Internet, I found that it is necessary to wet MongoCursor (from the namespace MongoDB.Dr ... y(new UiCustomizationDataContext(database.Object)); I'm making my own database, and I want to put my own in the collection.

Parsing the metanit site

I want to parse the site metanit.com Using standard tools(code example https://github.com/extremecodetv/Html-Parser-Tutorial ... download the entire browser engine. Do you know a better way? And why doesn't the regular System.Net.Http.HttpClient work ?

Mounting iso disk images by means of.Net

Is there in.Net tools for mounting iso disk images?

Displaying the log on the screen.NET 4 C#

Hello everyone. Tell me, how best to implement the display of the log on the screen? The log is displayed as text in real ti ... m the database (2-3 entries in the log for 1 record from the database). No output to the screen-processing takes 58 minutes.

How to ignore curly braces in the string.Format function

How do I ignore curly braces in the string.Format function? Example: string.Format("{Name:{0}}", "Value"); As a result of ... ring was not in a correct format. What should I do to get rid of the error and get the string as a result: {Name:Value}

Why pass an array by reference to the Array.Resize() method?

The abstract Array class has a static method Array.Resize(ref T[] array, int newSize), which, as you can see, takes the first ... mory in the heap and it creates a new reference to this memory or uses an existing one, that's where the "bastard is buried".

How to find out the characteristics of a PC by means of.NET?

Whether there is a possibility by means .HOW do I find out the characteristics of a PC (for example, for a processor: its name, frequency, number of cores, etc.)?

How to use the Include() method correctly in the Repository pattern?

When building an application, I use the Repository pattern. Repository interface: public interface IShopContext { IQuery ... d that the variables that should contain a reference to an object with a collection of orders are empty. What is the problem?

MonoTorrent-Getting *. torrent from the Magnet link

I have a torrent hash (MD5). The question is how to use MonoTorrent to download a torrent file. This can be done using a meth ... s = manager.Torrent.Files.ToList(); However, files turns out to be empty. The MagnetLink constructor probably doesn't work.

Crawling merged cells in Word

In general, in continuation of my previous topic on parsing Word tables using interop, I came across merged cells. How can I ... priority, as I have drawn a lot of code on it. If there is a solution for example for *. DOCX, then I can change the format.

Installing components.NET Framework 4.5

To install SharedPoint Server 2013 on Windows 7, you need to perform a few simple steps (according to instructions). One of ... mmunityServer.Blogs.Components.WeblogFiles/sharepoint-2013/SharePoint-2013-on-Windows-8-_2D00_-18.PNG What am I doing wrong?

Ways to use the #region and #endregion directives in C#

I read about #region and #endregion that they are needed for grouping class members, but I didn't find any more details. I want to understand in more detail.

No namespace (System.Windows.Forms.Clipboard)

I can't enable the use of the clipboard in the program. It just gives out that there is no such thing.

Obfuscation of C# code when using MVVM Light

Hello! I want to protect the program in C# (WPF, .NET 4.5.2) with an obfuscator. The fact is that using the MVVM Light framew ... gram is hacked, but I want at least basic protection, so that it is not hacked in 2 minutes in Reflector or dotPeek. Thanks.

ASP.Net MVC5 how to reset to default settings

I installed VS15, created an empty MVC5 project. And there's literally nothing there. I created the Controllers folder, threw ... c("Hello World!"); }); } Here's how I can reset my settings to default? To run the index method of the Home controller?

The difference between ViewBag and ViewData

Why do both ViewBag and ViewData exist? After all, in fact, they perform absolutely the same function - to store data for presentation. Is there a difference in the speed of page loading when using one or the other?

Compiling the application,.pdb file

Hey, everyone. You may notice that after compiling the application , Visual Studio adds .pdb files in addition to .exe files ... eption occurred. The question is, actually, is there any other practical use of these files (.pdb) in compiled application?

Multithreading and the for loop

Hello everyone. There are for example N threads, and there is a loop for(int i = 0; i<=100; i++) { //какие то действия ... ch thread does not start with 0. I.e. 1поток = 0 2поток = 1 3поток = 2 Nпоток = N Maybe I'm thinking the wrong way at all?

Line break after N character in c#

I have seen examples in various languages, but for c# I did not understand how to implement it, I ask for help. There is a text, for example, 20 characters. How to make a line break after 10 characters, for example? Thanks.