⌘BABAKOV.NET Let's code!
100% [light] [ru]
~/programming $

Development

102 total · page 9 / 11
Subsections

Working with PostgreSQL in C#

Not long ago, I started developing an application on C# based on PostgreSQL, and I'd like to share the information I've found. In this article, I'll describe what you need to connect to PostgreSQL from an application written in C#, and how to work with it using examples. ...

722 views 0 comments 0 likes ./Read →

Working with MySQL in C#

I hope this publication will not give readers the opportunity to repeat my mistakes and help make the initial correct choice. First, I would like to start with a strong recommendation: "When programming under .NET, always use MySQL .NET Connector!". Of course, you can connect to the database using ADO, but this is fraught with the fact that you will simply need to make changes when switching to Windows Vista and above.

47 views 0 comments 0 likes ./Read →

Copying a Folder with Subfolders and Files in C#

Always thought that .NET in System.IO had a method that implements folder copying with contents, including all subfolders and files. It turned out I was wrong, and there is no such method. Therefore, I bring an example of implementing this action using a fairly simple function with the help of System.IO.DirectoryInfo.

78 views 0 comments 0 likes ./Read →

Cutting a rectangular area of an image in C#

From the archive... Recently, I had to make a simple image cropping tool, so that the user could manually select an area on the source image and cut it out. In principle, nothing complicated, the most difficult thing is probably drawing the selection rectangle when you click the mouse button and move it over the image - highlighting the necessary area.<br><br>First, the most important thing. On the image <b>pictureBox</b> immediately set the <b>SizeMode</b> property to <i>AutoSize</i>, without any <i>Zoom-ы</i> if you don't want to deal with scaling.<br><br>Next - we need to make it work so that scrolling works when selecting with the mouse. It just so happened that this is a painful place in .NET (it doesn't work on its own, and that's it).<br><br>To make it work, do this:

244 views 0 comments 0 likes ./Read →

How to Open Images in C#

From the archive - might come in handy... It seems there's nothing simpler than opening an image from disk in C#. But, there are some pitfalls! Here are two examples. The first method (incorrect): if (openFileDialog1.ShowDialog() == DialogResult.OK) {…

97 views 0 comments 0 likes ./Read →

Changing Image Size in C#

From the archive - might come in handy... Often when adding images to a project, you need to change the image size, and often you want to do it properly, with the image proportions preserved. Personally, I often need to insert images into a ListView and shrink them correctly (so they don't spread out in a square of the specified size). This is exactly where the procedure below will help. <br><br>Size change procedure:

105 views 0 comments 0 likes ./Read →