There are no special problems with passing parameters to an application at startup in C#, it's done quite simply like this: static void Main(string[] args) { if (args.Length == 0) { MessageBox.Show("No parameters"); } else { MessageBox.Show("1");…
In this post, I will provide an example of how to get battery charge information on a Windows Mobile device. The code was written a long time ago. Recently, I needed it again. To get the battery charge, we use c...
A mobile device with .NET CF version 3.5 (and hopefully higher) support can be easily taught to play media files in the .WAV format. From this version, .NET CF has the necessary set of functions for playing sound files. Without further ado, I will provide simple examples.<br><br>Two examples of playing a sound file:<br><br>Example #1
So — when creating the .cab file for the first time, there may be an error when installing on a device, and it is likely to occur: The Windows CE CAB Wizard encountered an error. See the output window for more information. To understand what's going on, we look at what's really complaining about. We open: View->Output. There, we see this: Error: The INF file contains Unicode characters that could not be converted correctly to ANSI. The problem (in my case) was that in the project properties, Manufacturer was written in Russian. I changed it to English and everything started working fine.
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. ...
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.
Recently, I had to sort lists, and surprisingly, it turned out to be simple. Let's say we have a class: Creating a list: Now, to sort it by the ID field, we need to do just this: As you can see from the picture, I became curious about how quickly this all works.
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.
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:
XML File Processing Example in C#. A simple example that clearly shows how easy it is to break down an XML file into pieces.