compact-framework

Detecting 'Network Cable Unplugged' in the Compact Framework

徘徊边缘 提交于 2019-12-03 00:41:30
I've been through all of the Stack Overflow answers search comes up with, and neither Google or Bing are showing me any love. I need to know when a network cable has been connected or disconnected on a Windows CE device, preferrably, from a Compact Framework application. I realize I'm answering my own question here, but it was actually a question asked of via email, and I actually spent quite a while finding the answer, so I'm posting it here. So the general answer for how this is detected is that you have to call down into the NDIS driver via an IOCTL and tell it that you're interested in

Building Compact Framework applications with VS2010 (without VS2005)

99封情书 提交于 2019-12-03 00:19:10
I want to perform a .NET CF 2.0 build using VS2010. I know it's not supported "normnally," but I've seen this answer: ( .NET Compact Framework with Visual Studio 2010? ) ...and I want to use that approach. The blog post cited there says I need to modify the .csproj files for the .NET CF projects, to point to a particular Microsoft.CompactFramework.Common.targets . But I don't have that file. I figured I needed to install the Windows Mobile 6 Standard SDK to get it. I tried installing it and get this: I have seen this question: Windows Mobile 6 Standard SDK Refresh install issue on Visual

C# Deleting Directories

社会主义新天地 提交于 2019-12-02 20:01:04
问题 I'm working with the .NET Compact Framework 3.5 and want to delete some specific folders and their subfolders. When I run the app it gives IO exception. I've tried to use Directory.Delete(path) method but it didn't work. How can I solve this problem? Here is my code : using System; using System.Diagnostics; using System.IO; using System.Linq; using System.Collections.Generic; using System.Windows.Forms; namespace Reset_Client { static class Program { static void Main(){ myfunc(); MessageBox

Is WebClient really unavailable to .NET 3.5 CF?

早过忘川 提交于 2019-12-02 17:54:14
问题 My app targets Windows CE; it uses the Compact Framework I copied over some elsewhere-working code that uses WebClient, but it won't compile, saying, " The type or namespace name 'WebClient' could not be found (are you missing a using directive or an assembly reference?) " I do have a "using System.Net;" Because of that error, I also get, " The name 'HttpRequestHeader' does not exist in the current context " The code is: private static void SendXMLFile(string xmlFilepath, string uri) { using

Best way to manage network state in Windows Mobile

怎甘沉沦 提交于 2019-12-02 17:21:40
I have a .NET Compact Framework 3.5 program that is used as a 'Occasionally Connected' line of business (LOB) application. If it can see an online webservice, it will use that for data access, but if network connection is lost it will use a local cache. What is the best way to handle all of the connection options and state changes? OpenNetCF's ConnectionManager class? Microsoft.WindowsBile.State.SystemState? API calls? How do you get it to understand the difference between WiFi, Cradle, and GPRS and use the best method available? Anyone have any guidance on this? I just create a simple shared

GPS library for .NET compact framework

六月ゝ 毕业季﹏ 提交于 2019-12-02 17:20:35
I'm thinking of writing simple application for Windows Mobile devices, where user could simply enter destination coordinates, and the app would calculate distance and show direction to the destination. But I haven't found any Free , preferably Open Source library with simple API to work with GPS . Guido García I recently used open source SharpGPS . It's supposed to support more devices than the example in the SDK, but both solutions work on all my hardware. SharpGPS did make it easier to access more structured information, such as satellites in view and where they are, and has a brilliant

Windows Mobile App - Play Stream Over MMS Protocol?

社会主义新天地 提交于 2019-12-02 17:07:13
问题 NOTE: This question is being reasked because I accidentally clicked Community Wiki in the previous one, and obviously that didn't provide enough incentive in the form of reputation for people to answer it. Here is a link to the old question, please do not duplicate those answers (they weren't exactly helpful anyway): Link to Original Question Now here's the question... I'm trying to write a Windows Mobile app targeting Windows Mobile 6.x that will stream an internet radio stream delivered via

Why is this function returning nothing, although there is a match?

岁酱吖の 提交于 2019-12-02 16:26:34
问题 I am calling this (Compact Framework - this code runs on a Windows CE handheld device) method: public static List<string> GetXMLFiles(string fileType, string startingDir) { const string EXTENSION = ".XML"; string dirName = startingDir; var fileNames = new List<String>(); try { foreach (string f in Directory.GetFiles(dirName)) { string ext = Path.GetExtension(f).ToUpper(); string fileNameOnly = Path.GetFileNameWithoutExtension(f); if ((ext.Equals(EXTENSION, StringComparison.OrdinalIgnoreCase))

How can a SQL Server CE database be simultaneously connectable and un-?

人盡茶涼 提交于 2019-12-02 16:09:34
问题 I have a SQL Server CE database in my Windows CE app. I can see it (HHS.sdf) in my project in Server Explorer: ...but the Columns folders for the tables won't expand; clicking them gives me: The path property for HHS.sdf reads: Data Source=Mobile Device\Program Files\hhs\HHS.sdf If the path is not valid, why is Server Explorer showing me the database at all? If I create a new connection in Server Explorer (by selecting "Add Connection..." from the Data Connections context menu), I can

How can I remove the oldest lines in a file when using a FileStream and StreamWriter?

[亡魂溺海] 提交于 2019-12-02 13:05:11
Based on Prakash's answer here , I thought I'd try something like this to remove the oldest lines in a file prior to adding a new line to it: private ExceptionLoggingService() { _fileStream = File.OpenWrite(GetExecutionFolder() + "\\Application.log"); _streamWriter = new StreamWriter(_fileStream); } public void WriteLog(string message) { const int MAX_LINES_DESIRED = 1000; StringBuilder formattedMessage = new StringBuilder(); formattedMessage.AppendLine("Date: " + DateTime.Now.ToString()); formattedMessage.AppendLine("Message: " + message); // First, remove the earliest lines from the file if