Creating Your Own Service in C#
Here, I won't provide detailed instructions on which button to click and which menu to select in Visual Studio. I'll focus on the two main problematic issues I encountered when creating my own service. Per…
Here, I won't provide detailed instructions on which button to click and which menu to select in Visual Studio. I'll focus on the two main problematic issues I encountered when creating my own service. Per…
Archive - may be useful to someone Most modern phone models support the vibration alert function, so it can be used (for example, in games when explosions occur to add more realism, or when writing communication programs, to notify the user of incoming messages while the device is in a pocket).
Simple way to send email using standard means. To do this, we need to connect libraries: using System.Net; using System.Net.Mail; using System.Net.Mime; The code for sending a letter with an attachment: // Specify the SMTP server and authenticate...
There may be many methods for converting a color image to black and white, and possibly even more advanced ones, but for now, the method presented below is the fastest among the ones I know. The conversion uses only standard libraries. The method's essence is not to work with the image itself, but to work with a block of data. If simplified, it's just freezing the image data in memory, modifying it as needed, and returning it to its original state.
I once had a task to compile a program for different devices. A range of devices in my case have specific capabilities and use special libraries, while for some ordinary devices, these libraries need to be excluded. Of course, you can comment out each time, but there are many inclusions and this approach is quite problematic.
This is the simplest and most primitive example, may be useful, but better to use OpenXML. In this publication, an example of creating and displaying an Excel document from a program written in C# is presented. The most primitive example is presented for educational purposes.
The essence of generating the EAN-13 barcode is to find the control digit (the last 13th digit). The algorithm for finding this value is as follows: 1) Leave 12 digits (the last 13 - the control digit we are looking for).…
Publication from archives, might be useful... Once I encountered the need to take screenshots from a PDA, and I couldn't find any suitable program. Specifically, a simple, small one that doesn't install anything, but works. I decided to write it, spent two hours digging the internet about how to do it - it turned out not to be so simple, only through API on mobile devices.
Simple example of reading incoming data from the COM port using SerialPort in C#. Everything is quite simple, to get the data, we will need to use the DataReceived event. Example: private string stroka=""; private void se…
Interpolated string in C# is a string preceded by the $ symbol. Such a string may contain special expressions in curly brackets: int x = 18; Console.Write($"Specified age {x} years."); // Outputs: Specified age 18 years.