compact-framework

ZXing.Net Encode string to QR Code in CF

北战南征 提交于 2019-11-29 13:54:40
问题 How could I encode my string into a QR Code using ZXing.Net? I can already decode, but having problems in encoding. It has an error that says: no encoder available for format AZTEC . Here is my code: IBarcodeWriter writer = new BarcodeWriter(); Bitmap barcodeBitmap; var result = writer.Encode("Hello").ToBitmap(); barcodeBitmap = new Bitmap(result); pictureBox1.Image = barcodeBitmap; 回答1: You doesn't fully initialize the BarcodeWriter. You have to set the barcode format. Try the following code

How to play audio from resource

寵の児 提交于 2019-11-29 13:53:05
I am trying to play audio from a resource using .NET Compact Framework. I added an audio file for the resource property in my application and am trying to use the below sample resource file reference code for... SoundPlayer player = new SoundPlayer(Assembly.GetExecutingAssembly(). GetManifestResourceStream("blessedwav.wav")); player.Play(); But this code doesn't play a WAV sound. How do I play the resource audio file using .NET Compact Framework 3.5? user228502 I got the solution. This code is working very well in .NET Compact Framework: // Convert a byte array to a stream using (var

Should I call “SqlCeEngine.Upgrade()” when both the SDF file and the device are seemingly the same version (2)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 12:58:58
This is a followup to a question here ctacke said there regarding SQL Server CE-related "issues" I was/am having: " The problem, as indicated by the error text, is that the SDF file was created by a version of SQL Compact that doesn't match the version of SQL Compact that the application is referencing. I wouldn't focus on the reported version numbers, just the fact that it knows there's a mismatch. If you don't know the version of the SDF, you can always look it up by reading a few bytes from the SDF file. SQL Compact database files aren't 100% transportable. You definitely cannot take an SDF

Watermarked Textbox for Compact Framework

梦想的初衷 提交于 2019-11-29 12:41:32
Does anyone know if anyone makes a watermarked textbox control for the compact framework? I already loked at the following and didn't see one. Component One Mobile Pocket PC Controls Resco Mobile Forms Toolkit Daniel Moth has a pretty good blog post about how to do this here: TextBox with cue banner support for Windows Mobile Best of all it is simple and free! I've never seen one. This project shows how to do it yourself - not sure if it would work on CF, but I didn't see any obvious non-CF supported stuff in the example. 来源: https://stackoverflow.com/questions/174796/watermarked-textbox-for

P/Invoking function via a mangled name

孤街醉人 提交于 2019-11-29 12:11:39
I'm trying to call an function in an unmanaged c++ dll in .net cf 3.5 in a windows ce 6.0 environment. The struct is defined as: typedef struct TagOperatorInfo { DWORD dwMode; DWORD dwFormat; //Operator name format DWORD dwAct; //Network type(Available in 3G module£ºGSM or 3G), TCHAR szOper[32]; }OperatorInfo,*LPOperatorInfo; and the function call is: BOOL GetCurOperatorInfo(LPOperatorInfo pinfo); I defined in .net the TagOperatorInfo as follows: [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices

Windows Mobile Compact Framework Build Error: CAB file … could not be created

眉间皱痕 提交于 2019-11-29 10:58:25
I get the following error when trying to build a .CAB in visual studio on my new PC. The source is identical. The Registry warnings are not present on the old PC either. Windows CE CAB Wizard Warning: Section [RegKeys] has no data Warning: Section [DefaultInstall] key "AddReg" - there are no section entries to process Error: CAB file "D:\Dev\...\MyProject.CAB" could not be created ERROR: The Windows CE CAB Wizard encountered an error. See the output window for more information. No other errors show in the build log for the cabwiz.exe build step. Any suggestions? Move the source code to C:

How to safely store encryption key in a .NET assembly

巧了我就是萌 提交于 2019-11-29 09:45:46
In order to prevent somebody from grabbing my data easily, I cache data from my service as encrypted files (copy protection, basically). However, in order to do this, I must store the encryption key within the .NET assembly so it is able to encrypt and decrypt these files. Being aware of tools like Red Gate's .NET Reflector which can pull my key right out, I get a feeling that this is not a very safe way of doing it... are there any best practices to doing this? You have to decide what is an acceptable level of risk. There is no "safe" way of doing this. If the risk of someone using reflector,

Can't find PInvoke DLL error in Windows Mobile

半城伤御伤魂 提交于 2019-11-29 09:28:27
I am having a lot of trouble getting a basic scenario to work on windows mobile 5.0 emulator. I have a winforms app that eventually calls into native code. Deployment works fine and all the native DLLs are copied in the same folder as the winforms .exe. I also verified this is the case with Remote File Viewer tool. However when I launch my app, it always fails with "Can't find PInvoke dll -- System.MissingMethodException" error (when the time comes to call into native code, the DllImport attribute is rendered useless). I know that the native dll is found in the same folder as the executable.

How can I shutdown a Windows Mobile device programatically

情到浓时终转凉″ 提交于 2019-11-29 08:19:14
I would like to programatically shutdown a Windows Mobile device using Compact framework 2.0, Windows mobile 5.0 SDK. Regards, It probably not a great idea to do it from your app - the device has a power button for a reason and shutting down the app can cause user confusion and frustration. If you must do it, and you are using Windows Mobile 5.0 or later, you can P/Invoke ExitWindowsEx like this: [Flags] public enum ExitFlags { Reboot = 0x02, PowerOff = 0x08 } [DllImport("coredll")] public static extern int ExitWindowsEx(ExitFlags flags, int reserved); ... ExitWindowsEx(ExitFlags.PowerOff, 0);

How can I establish a secure channel for SSL/TLS from a handheld device?

可紊 提交于 2019-11-29 08:13:20
I am trying to call a REST method from a handheld device (Windows CE / Compact framework) with this code: public static HttpWebRequest SendHTTPRequestNoCredentials(string uri, HttpMethods method, string data, string contentType) { ExceptionLoggingService.Instance.WriteLog("Reached fileXferREST.SendHTTPRequestNoCredentials"); WebRequest request = null; try { request = WebRequest.Create(uri); request.Method = Enum.ToObject(typeof(HttpMethods), method).ToString(); request.ContentType = contentType; ((HttpWebRequest)request).Accept = contentType; ((HttpWebRequest)request).KeepAlive = false; (