compact-framework

C# DirectoryInfo.GetFiles wildcard search

ぐ巨炮叔叔 提交于 2019-12-20 03:36:26
问题 I am experiencing differences in behavior in the following code segment DirectoryInfo di = new DirectoryInfo("c:\"); FileInfo[] textFiles = di.GetFiles("log_???.???.txt"); Where ? is the wildcard for 0 or 1 characters, so this should return files in the path matching the patterns: log_..txt log_0.0.txt log_00.00.txt log_000.000.txt All of these files are returned when compiled for Windows .NET framework 3.5 (desktop), but on the target embedded Windows CE 6 with .NET Compact Embedded

.net cf - launch explorer programmatically

淺唱寂寞╮ 提交于 2019-12-20 03:22:20
问题 I am trying to launch explorer programmatically from my .Net CF Window application. But its throwing win32 exception. I have used same kind of code in desktop .Net version, and it always worked. (I am using Windows CE 5 and .Net CF 3.5 ) Following code throws Win32 Exception, Process.Start("\\", null); Unfortunately, I am using the code like this :-( try { Process.Start("\\", null); } catch { } 回答1: Maybe you should give it a program name to start? "\" is not an application. Something like

Why is WMDC/ActiveSync so flaky?

笑着哭i 提交于 2019-12-20 02:33:05
问题 I'm developing a Windows Mobile app using the .NET Compact Framework 3.5 and VS2008, and for debugging using the Device Emulator V3, on Win7, and seem to have constant problems with Windows Mobile Device Centre (6.1) connecting. Using the Emulator Manager (9.0.21022.8) I cradle the device using DMA in WMDC. The problem is it's so flaky at actually connecting that it's becoming a pain. I find that when I turn my computer on, before I can get it to connect I have to open up WMDC, disable

How do I get the Emulator on the same network as my PC?

余生长醉 提交于 2019-12-19 22:12:51
问题 I've created some Web API methods in .NET 4 / Visual Studio 2010 (and have now ported it to VS 2013 RC). I want to consume them from a Windows CE / Compact Framework app using RestSharp. Regardless of how I call these methods, though, I need to know the IP Address to use for the app running the Web API methods. I can access it from a browser using "localhost" and the port number Visual Studio displays when running the View for the Web API project in the browser (works fine, returns XML in

Draw border around bitmap

帅比萌擦擦* 提交于 2019-12-19 08:44:27
问题 I have got a System.Drawing.Bitmap in my code. The width is fix, the height varies. What I want to do, is to add a white border around the bitmap, with about 20 pixel, to all 4 edges. How would this work? 回答1: You could draw a rectangle behind the bitmap. The width of the rectangle would be (Bitmap.Width + BorderWidth * 2), and the position would be (Bitmap.Position - new Point(BorderWidth, BorderWidth)). Or at least that's the way I'd go about it. EDIT: Here is some actual source code

Draw border around bitmap

拜拜、爱过 提交于 2019-12-19 08:44:10
问题 I have got a System.Drawing.Bitmap in my code. The width is fix, the height varies. What I want to do, is to add a white border around the bitmap, with about 20 pixel, to all 4 edges. How would this work? 回答1: You could draw a rectangle behind the bitmap. The width of the rectangle would be (Bitmap.Width + BorderWidth * 2), and the position would be (Bitmap.Position - new Point(BorderWidth, BorderWidth)). Or at least that's the way I'd go about it. EDIT: Here is some actual source code

Reboot Windows Mobile 6.x device programmatically using C#

若如初见. 提交于 2019-12-19 03:19:01
问题 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#? 回答1: 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

Pocket PC/Windows Mobile: How to detect smart minimize

徘徊边缘 提交于 2019-12-18 16:27:22
问题 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

What are some techniques for troubleshooting very intermittent Access Violation on a Windows Mobile Device?

风流意气都作罢 提交于 2019-12-18 13:54:30
问题 I have a large Compact Frameworks V2.0 application that in most cases works very well. On certain devices about once a day, a user receives a Native Error 0xC0000005 that is not caught with the standard managed Try/Catch block. My application synchronizes with the server via ASMX calls at fixed intervals. The problem appears to occur during synchronization. There is considerable business logic in addition to the ASMX call that happens at the time of the synchronization, but 98% of that is

How can I have design time support for my custom user controls in Visual Studio 2008?

别等时光非礼了梦想. 提交于 2019-12-18 13:38:02
问题 I'm an creating a custom user control for .NET Compact Framework and I want to keep design time support. I'd like to think in Visual Studio 2008 that this is not the crazy almost impossible task it once used to be. And I'm hoping there is a simple tutorial somewhere that will show me, it is a snap. Any chance? 回答1: There is a sample you can download here that shows how to incorporate a WYSIWYG design-time experience. Also there is annother tutorial here. Look at the section on the "Designer".