compact-framework

How do I set Network Management settings or make the dialog appear in C# on Windows Mobile?

我们两清 提交于 2019-11-28 01:25:57
In Windows Mobile, when you open Internet Explorer and type in a URL that your device can't connect to, you are notified of this and prompted to (manually) navigate to the screen where you can actually do something about this as a user (Network Management), like so: alt text http://www.freeimagehosting.net/uploads/d3d95e00d2.gif However, if a .NET Compact Framework application tries to connect to a webservice and the webservice URL is not reachable, the "Cannot Connect" bubble does not appear, and instead the call to the webservice just fails. Sometimes we end up talking customers through this

Get ip address of host pc from windows mobile when connected via ActiveSync

一曲冷凌霜 提交于 2019-11-28 01:08:08
问题 I have a .Net Compact app running on Windows Mobile, and I want to be able to connect to a webservice running on the 'host' machine (i.e. the desktop the PDA is plugged into) when connected via ActiveSync, but I don't know the ip address of the host. How can I find the ip of the desktop PC progromatically on the PDA? 回答1: I've found a KB article How To Retrieve the IP Address of the Remote PPP Peer, which uses the host "PPP_Peer". So I tried: Dns.GetHostEntry("PPP_Peer").AddressList[0] And

Is there any program that obfuscates C# source code? [closed]

自古美人都是妖i 提交于 2019-11-28 00:28:14
问题 Our requirement is being able to integrate our DLLs with ClickOnce. Dotfuscator does the obfuscation job nicely but the obfuscated DLLs cannot be deployed with ClickOnce on customer side. On our side, we can handle it perfectly. Moreover, the obfuscated assemblies sometime crash our .NET CF app. It turns out to a solution that creates a temporary source and obfuscates it before compiling with VS. This ensures that the compiled assembly can be integrated with ClickOnce and fully compatible

C# Application.Run without Form

混江龙づ霸主 提交于 2019-11-27 23:46:52
Is it possible to call Application.Run, but to not pass a form parameter, or is there an alternative if there’s no form to call? The Run method doesn’t seem to have any overloads that don’t accept a form. For example, if I wanted to instantiate a class first, and then have that call the form, is there way to do the equivalent of: Application.Run(myClass); Just to clarify, I do still want the functionality that .Run() provides. That is, establish a loop to keep the application running, but instead of tracking a form, track a class or other object. This is relating to the compact framework

How to lock file

巧了我就是萌 提交于 2019-11-27 23:33:44
please tell me how to lock file in c# Thanks Simply open it exclusively: using (FileStream fs = File.Open("MyFile.txt", FileMode.Open, FileAccess.Read, FileShare.None)) { // use fs } Ref . Update : In response to comment from poster: According to the online MSDN doco , File.Open is supported in .Net Compact Framework 1.0 and 2.0. FileShare.None would throw a "System.IO.IOException" error if another thread is trying to access the file. You could use some function using try/catch to wait for the file to be released. Example here . Or you could use a lock statement with some "dummy" variable

PBKDF2 in Bouncy Castle C#

岁酱吖の 提交于 2019-11-27 21:24:52
I've being messing around the C# Bouncy Castle API to find how to do a PBKDF2 key derivation. I am really clueless right now. I tried reading through the Pkcs5S2ParametersGenerator.cs and PBKDF2Params.cs files but i really cant figure out how to do it. According to the research I have done so far, PBKDF2 requires a string (or char[]) which is the password, a salt and an iteration count. So far the most promising and most obvious i've come so far is the PBKDF2Params and Pkcs5S2ParametersGenerator. None of these seems to be accepting a string or a char[]. Has anyone done this in C# or have any

Server-generated keys and server-generated values are not supported by SQL Server Compact

女生的网名这么多〃 提交于 2019-11-27 19:38:38
I just started to play with the entity framework, so I decided to connect it to my existing SQL Server CE database. I have a table with an IDENTITY(1, 1) primary key but when I tried to add an entity, I've got the above-mentioned error. From MS Technet artice I learned that SQL Server Compact does not support entities with server-generated keys or values when it is used with the Entity Framework. When using the Entity Framework, an entity’s keys may be marked as server generated. This enables the database to generate a value for the key on insertion or entity creation. Additionally, zero or

is there a clean way to play an mp3 sound in the compact framework 3.5

情到浓时终转凉″ 提交于 2019-11-27 18:52:24
问题 I use the p/invoke method to play wav sounds. There are ways of calling windows media player to play an mp3 sound, but its slow & cumbersome. Is there an easy way to play a short mp3 file? This is primarily for application prompting and audible cues when you are not looking at the screen and not music. Thanks! 回答1: CF Framework 3.5 now includes support for playing .WAV files: Namespace System.Media.SoundPlayer Short WAV files for cues and sound-effects might even play faster than MP3s since

how to make a mobile application stay on top?

廉价感情. 提交于 2019-11-27 17:00:56
问题 I am developing a mobile application for Windows Mobile. I would like that the application is lauched by default by the system at startup and that users cannot minimize it. So only this application is available, all other features are disabled. I m sure that I could define a launcher, which is executed at startup. But some problems come into my mind: could there be some memory optimizations ? I mean, because only one application is available and used, maybe some other programs could be

Transparency in compact framework

拜拜、爱过 提交于 2019-11-27 16:43:39
问题 I need to create a image with a transparent background in .NETCF, I use magenta as the background I wish to make transparent. The way I have tried to do this is to override onPaint(). But I can't get the background transparent? Here's what I have: protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; ImageAttributes imageAttributs = new ImageAttributes(); imageAttributs.SetColorKey(Color.FromArgb(255, 0, 255), Color.FromArgb(255, 0, 255)); g.DrawImage(cross, crossRect,