.net

windows xp tablet pc sdk on mono

I've been in development of an app that utilizes the windows tablet pc sdk. The only thing I really use from it is the InkPicture control. I'm wondering, the InkPicture control obviously isn't built into .NET, but it is a managed object, so would it work under mono? I'm downloading MOMA now, but I was just wondering if anyone knew alre...

Question regarding generation of ASP.NET MVC "Create" Views

Simplest case, I'm creating a "Create View" for a task list, and I want to allow the user to select a "Category" from a related table via a dropdownlist. Should I Create a custom model that contains a Task and an IEnumerable? Instanciate the CategoryController from the "Create Task View" and bind the DDL via a method on the CategoryC...

Load and display image as slideshow from the Server directory(folder)

I use .NET C# , I dynamically create folder to store the image I upload, ex: strFolder = Server.MapPath("./folder/folder_"+folid+"/") So I could create different folders according to the page unique id. I have also created a thumbnail image from the image I have upload (cropped ones). The problem I am trying to figure out is to disp...

How does one use ManagementEventWatcher to keep track of suspend/resume?

Hey all, I am trying to use ManagementEventWatcher in a service to keep track of when a computer goes in and out of sleep mode. I am new to .NET and C# so I am struggling quite a bit to come up with syntax to make this work. I have found a blog post that details how he used ManagementEventWatcher to keep track of this status, but he d...

Is it possible to declare a dynamic constant in VB .NET?

I'm trying to save a timestamp into a constant at the beginning of a program's execution to be used throughout the program. For example: Const TIME_STAMP = Format(Now(), "hhmm") However, this code generates a compiler error - "Constant expression is required." Does that mean all constants in VB .NET have to contain flat, static, hard-c...

Pros/Cons of using an assembly as a license file?

I was initially going to use a signed serialized xml file to store license details. In planning, more and more has moved into this "license file" which will allow for us to distribute a single application and control available functions via the supplied license file. The UI and printed reports are co-branded with distributors logos, so...

Why do I see a console window when I run a dynamically compiled EXE?

So I have a program that dynamically compiles a new program at the click of a button. The new program generates and works perfectly. The only weird thing is that when I run this newly generated exe, first a console window opens, the title is "C:\calculator.exe" and then my calculator.exe program opens. For some reason it is starting ...

How to restore a minimized window using AppActivate(ProcessID)

The documentation for AppActivate(ProcessID) states... The AppActivate function changes the focus to the named application or window but does not affect whether it is maximized or minimized. Unfortunately, it doesn't then advise how you CAN un-Minimize an application from the task bar when you want it activated. I can't fin...

Aptify (.NET CRM Solution) to MailChimp Synchronization

I'm trying to determine what is involved in synchronizing MailChimp, the popular bulk email service, with Aptify, the .NET-powered CRM my company uses. MailChimp supplies a .NET wrapper DLL which should make this process much easier. They also advertise a 3rd-party solution: Sync Module for .Net systems - MailChimp Sync Module make...

Reordering XML nodes according to defined schema

I'm merging a couple of .xml files together, and need to take certain child elements from each .xml document and put them into a 3rd. And that's OK, but the problem is that then my "child" nodes are in a somewhat random order (well, what I picked from the first file, followed by what I picked from the 2nd), and the schema file (the .xsd...

.Net with single .exe without .NET Framework installation

I wrote my simple desktop program in C#. I am reluctant to distribute it on the internet because i am not sure if users will go through pain of installing the .Net Framework. My target users are non-tech savvy users. I am very familiar with MFC and I probably can write this program in MFC in a month. MFC is nice because I don't have to ...

Is it possible to get the contents of a loaded .net assembly as a byte array or stream?

Is it possible to get the contents of a loaded .net assembly as a byte array or stream? What I'm trying to do is something similar to (of course the real scenario is much more complex, so just storing the buffer is not an option). byte[] bytes = GetTheBytes(); Assembly asm = Assembly.Load(bytes); byte[] bytes2 = GetAssemblyAsByteArray(...

Code Contracts: Is it possible to supply a contract class for a generic interface?

I have just got started using Microsoft's Code Contracts and already ran into a problem that I can't solve. Let's take this interface for which I'd like to specify a contract: public interface IRandomWriteAccessible<T> { T this[uint index] { set; } uint Length { get; } } The documentation says to use the ContractClass attribu...

.NET custom event organization assistance

Being relatively new to C#, I've been researching custom events recently, and while I think I now understand the basic pieces required to setup a custom event, I'm having trouble determining where each piece belongs. Specifically, here's what I'm trying to do. I have a tree control that represents the layout of an internal data structu...

Setting Registry key write permissions using .NET

I'm trying to grant Write access to my application's registry settings to everyone or all users of a machine during the install process. My application does not have the appropriate permissions directly after install without requiring an administrator to grant them even though the keys and values exists, they cannot be updated? I've ...

.net Hashtable insert failed. Load factor too high.

Hello, I'm getting this error: Hashtable insert failed. Load factor too high. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Hashtabl...

Get Class level instance of a variable (not Interface)

If I have the following scenario public interface IFace { int NoseSize {get; set;} } public class Face: IFace { private int NoseSize; public int IFace.NoseSize { get { return ClassLevel.NoseSize} set { ClassLevel.NoseSize = value} } } How do I really indicate "ClassLevel"? ...

Auto Property - Resharper error or Cool Unknown C# Feature?

I have the following code: public interface IMyInterface { DataGrid ItemsInGrid { get; set; } } partial public class MyClass: Window, IMyInterface { public DataGrid ItemsInGrid { get { return grdItemsInGrid} set { grdItemsInGrid= value; } } } In a Different file: partial public class MyClass: Window { ...

Edit Text in SWF File

I am wondering the capabilities of the SWF Format. I have some text in a Flash Video, which is an email address ([email protected]) which I would like to write a C# application to edit. I have the SWF File Format Spec and was wondering if the following is possible: If I read in the Tag (I am assuming this text is stored as a Static Te...

Authenticating to a server in .NET using NTLMv1

I am working on a Win7 system with the local security policy Network Security: LAN Manager authentication level set to use NTLMv2 only. In a piece of code I am using the .NET WebClient class as follows: WebClient webClient = new WebClient(); NetworkCredential networkCredential = new NetworkCredential(DomainAccountUserName, DomainAc...