compact-framework

Compact Framework - Get Storage Card Serial Number

半腔热情 提交于 2019-11-30 21:51:04
Morning all, How would I go about getting the serial number of the storage/sd card on my mobile device? I am using C#.Net 2.0 on the Compact Framework V2.0. Thanks. The Smart Device Framework provides a mechanism to get SD Card serial numbers and manufacturer IDs. I'm not on a machine that I can get the syntax for you but I believe you can use the System.IO namespace to get IO based attributes. First get a DirectoryInfo to the storage card. (I'm not 100% on the code here, you may need to test, I'll update it if I can get to my machine) public DirectoryInfo GetStorageCard() { DirectoryInfo

Store an image in a SQL Server CE database

☆樱花仙子☆ 提交于 2019-11-30 20:59:23
Does any one know of an example on how to store an image in a SQL Server CE database? What data type should the column be? (I am guessing binary.) I use Linq-To-Datasets. Is it possible using that to put the image into the database and pull it out again later? Thanks for any advice. Here is how I did it: MemoryStream stream = new MemoryStream(); myBitmapImage.Save(stream, ImageFormat.Png); myInsertLinqToDataSetRow.IMAGE_COLUMN = stream.ToArray(); To load it back out again I did this: MemoryStream stream = new MemoryStream(myLinqToDataSetRow.IMAGE_COLUMN); myBitmapImage.SignatureImage = new

Reboot Windows Mobile 6.x device programmatically using C#

旧街凉风 提交于 2019-11-30 20:58:40
My HTC HD2 can't be rebooted from OS, just shut down. So I want to write a small program to do that. Is it possible to programmatically reboot Windows Mobile 6.x device using C#? Trevor Balcom You should use the documented ExitWindowsEx API. IOCTL should only be used on platforms lacking the ExitWindowsEx function call (Pocket PC 2000, 2002, and 2003). See the MSDN doc for more information. [DllImport("aygshell.dll", SetLastError=""true"")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool ExitWindowsEx([MarshalAs(UnmanagedType.U4)]uint dwFlags, [MarshalAs(UnmanagedType.U4)]uint

C# - Code compiler for .NET & CF.NET

时光怂恿深爱的人放手 提交于 2019-11-30 17:56:43
问题 I've a same project that need to be compiled with .NET and Compact .NET Framework. It is possible to create a C# compiler that will compile my project with both framework ? Some feature aren't present in CF.NET Framework so I created it by myself (creating classes having exactly the same name & options that in .NET Framework. If I decore this classes with an attribute like [CF35] it's possible to parse the project and : Use this class when compile the project using CF.NET Ignore this class

Compact Framework - Get Storage Card Serial Number

我只是一个虾纸丫 提交于 2019-11-30 17:31:25
问题 Morning all, How would I go about getting the serial number of the storage/sd card on my mobile device? I am using C#.Net 2.0 on the Compact Framework V2.0. Thanks. 回答1: The Smart Device Framework provides a mechanism to get SD Card serial numbers and manufacturer IDs. 回答2: I'm not on a machine that I can get the syntax for you but I believe you can use the System.IO namespace to get IO based attributes. First get a DirectoryInfo to the storage card. (I'm not 100% on the code here, you may

.net cf TextBox that displays keyboard on focus

做~自己de王妃 提交于 2019-11-30 15:57:12
问题 I have a few text boxes on my UI that I want to display the mobile keyboard for when the control has focus, then go away. Note: for this particular program, it is a tall screen and has no physical keyboard on the device. 回答1: Add an InputPanel to your Form, hook up the GotFocus and LostFocus events of the TextBox and show/hide the input panel in the event handlers: private void TextBox_GotFocus(object sender, EventArgs e) { SetKeyboardVisible(true); } private void TextBox_LostFocus(object

Designing forms to work on different resolutions and aspect ratios on Windows CE

混江龙づ霸主 提交于 2019-11-30 14:16:31
I have a .NET 2.0 application that runs on Compact Framework. It has a bunch of different forms that were all originally designed to run on a specific device with a specific screen resolution. I'm now looking to get this application to run on some other devices that have very different screen resolutions (some have completely opposite aspect ratios where the screen is now taller than it is wide). My question is how can I change my forms to look good on these other screens? This is a bit different from designing forms on the full framework since I have to design these forms to take up the full

Pocket PC/Windows Mobile: How to detect smart minimize

核能气质少年 提交于 2019-11-30 13:50:17
How do I detect when my Compact Framework application is being smart-minimized (smart minimize is what happens when the user clicks the "X" button in the top-right corner on a Pocket PC)? The Deactivate event isn't the right way because it occurs in circumstances other than minimization, such as when a message box or another form is shown on top of the main form. And the form's WindowState doesn't help because there is no "Minimized" WindowState on .NET CF. I heard that by setting MinimizeBox = false, my app will be closed instead of minimized. But I actually don't want my app to close, I just

Developing applications for Windows Embedded Compact 2013

两盒软妹~` 提交于 2019-11-30 13:47:25
Today I stumbled over the Application Builder for CE 2013 in Microsoft's download center. As of the description, with this pack I should be able to develop apps that target Windows Embedded Compact 2013 with Visual Studio 2012. After downloading and installing the Application Builder I found the new framework assemblies in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsEmbeddedCompact\v3.9 , but there are no project templates targeting Embedded Compact 2013 in Visual Studio 2012. I tried to create a blank WinForms or WPF project and to retarget it to 3.9, but that doesn

“Compatibility Pack” for backporting new .NET Framework features?

走远了吗. 提交于 2019-11-30 11:35:33
For various reasons I often find it desirable to write code that is compatible with .NET framework 2.0 or 3.5 or compatible with the .NET Compact Framework, but it is a problem that there are numerous "small" features in new .NET frameworks that are not available in the older frameworks or Compact Framework. For example, I find extension methods are really useful, but the compiler depends on System.Runtime.CompilerServices.ExtensionAttribute for this. You can easily define this attribute yourself and then use extension methods in .NET Framework 2.0 (under C# 3.0+). Likewise, it isn't too hard