⌘BABAKOV.NET Let's code!
100% [light] [ru]

Useful things for .NET Compact Framework

Here I will provide some very useful things when developing on .NET Compact Framework.

So, let's get started:

Learn the version of .NET Compact Framework

FrmTxt.Text = Environment.Version.ToString();



Learn the version of the operating system

OsVersion.Text = Environment.OSVersion.ToString();



Learn the path to the running application

using System.IO;
using System.Reflection;

MyAppDir.Text = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModule()[0].FullyQualifiedName).ToString();



Learn the device name

NameKPK.Text = System.Net.Dns.GetHostName().ToString();



Learn the screen orientation

MyScreen.Text = Screen.PrimaryScreen.Bounds.Width.ToString() + ":" + Screen.PrimaryScreen.Bounds.Height.ToString();



Open a file by default application or launch another application

System.Diagnostics.Process.Start("\\\\My Documents\\\\file.mp3");



Create and send a letter

System.Diagnostics.Process.Start("mailto:roman.vasilich@kbss.ru?subject=Test Mail.", null);



P.S. All examples for .NET CF version not lower than 2.0!

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.