.net

How to host a simple ASP.NET web interface in a Windows Services

For a simple appliance that runs on a Windows & .NET operating system, we need to create a simple configuration web interface to control it. Just like your router's configuration page, nothing more complicated than that. Installing IIS or any other web server should be avoided, what we need is a self supporting process within a windows ...

A way How to Compile C library into .Net dll ?

Can we compile C library as .Net dll (containing and opening access to all C libs functions) by just compiling cpp project containing code like extern "C" { #include <library.h> } with /clr:pure argument with VS? (VS10) Or we should do something more trickey? ...

How to encrypt a alphnumeric serial number so user canot judge next number

I want to generate serial number alphanumeric of 8 digits. But i also want to hide/encrypt the number so no one can judge next number. And also i want to keep the length after encryption or sum shuffling mechanism. For example my series like this: 1000002A 1000002B 1000002C Any idea? ...

Reactive Framework Hello World

This is an easy program to introduce Reactive Framework. But I want to try the error handler, by modifying the program to be: var cookiePieces = Observable.Range(1, 10); cookiePieces.Subscribe(x => { Console.WriteLine("{0}! {0} pieces of cookie!", x); throw new Exception(); // newly added by myself }, ex => Cons...

From where can i get CTS hierarchy ? where does interface type fits in the CTS hierarchy

It says there are basically two types 1) Value type and reference type. all value types are dereived from system.valuetype 1) Is there any thing like system.referencetype , because every CTS hierarchy i have seen shows two types below system.objects , a Valuetype and a Referencetype My understanding is all types that are derieved from...

Counting change operations c#

Hi Guys, I have an aplication which performs some basic morphological analysis, and I am looking for an efficient means to count the number of change operations needed to transform a word into another, character by character changes. Thanks in advance people. ...

Do interfaces derive from System.Object? C# spec says yes, Eric says no, reality says no.

Question is simple and asked in the title. C# 4.0 Specification says: (§4.2.2) The object class type is the ultimate base class of all other types. Every type in C# directly or indirectly derives from the object class type. Eric Lippert says: ( http://blogs.msdn.com/b/ericlippert/archive/2009/08/06/not-everything-derives-fro...

How do you allow users to input values for your Immediacy Plugin via the Extended Tab?

I am currently building my first Immediacy Plugin, and do not have access to any documentation at the time of writing this. I have created a user control (single inline file, as opposed to code behind) that produces the required output. However I need a way of passing an integer specified the page creator to the control. I've seen this...

Bug or new convention for namespace declaration in .Net 4.0

Visual Studio 2010, .Net 4.0 I'm generating some Domain Service Classes and this is how visual studio includes the namespaces: namespace MyCoolProject.Web.Services { using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Data.Linq; u...

javascript viewstate problem

I have a situation that I am stuck with, and hoping someone can help. I am building a .NET/C# web application in which I have a tabbed panel layout, and when the user clicks on each of the tabs the display panel is updated using javascript to hide and show some divs. None of these clicks cause postback, it is all client-side, so I can't ...

Expose a class library as a "WCF Data Service"

Is it possible to expose a .NET (class) library through a WCF Data Service ? Makes this scenario sense ? Or is the usage of pure WCF the best and only way in this case ? Background: I have several (old) C# classlibraries (which encapsulate the access to different datasources), which I want to use with Ajax and Silverlight. I cannot and ...

What is the best sort algorithm for a random set of floats?

A colleague of mine just put that question out in the air this afternoon, and somewhat left me curious. I'm versed with sorting algos, but lacking a formal degree in compsci / compeng (something I'm sorta averse to admitting), can't really place my finger on this one. :p And oh yeah, this is mildly in the context of a C#/.NET implementa...

Templated usercontrol with template properties

In C#, I'm trying to figure out a way to use properties inside a templated usercontrol. Let me try to explain what I mean through an exmaple: <example:myTreeOfItems runat="server"> <HeaderTemplate> <div> </HeaderTemplate> <IndentStartTemplate> <ul> </IndentStartTemplate> <ItemHeaderDefaultTemplate> ...

Binary serialization for compact framework 3.5

I just realized that CF3.5 doesn't support the binary formatter. I'm using it to send objects over the network and now need to use something else to serialize my data... I heard about Google protocol buffers but found a version that has a bug under CF... What serialization framework is good for CF? Update: I forgot to mention, I need ...

Twitter is scared of my lengthy url - gotta shorten it! [c#]

Hi There, I have a website where everytime one of our customers reviews a new product it gets tweeted onto the company twitter account automatically. for the actual tweeting, i am using the twitter api's directly, without any wrapper classes and libraries. its all working fine, except, when the post gets too lengthy, it doesnt get twee...

C# Default optional parameter chooser

public ClassType(string type) { Type = type; } public ClassType(string type,bool isArray=false) { Type = type; IsArray = isArray; } ClassType ct = new ClassType("adsf"); Which constructor is chosen? ...

EditorAttribute not working

Hi guys, namespace MyNamespace { public class XYZEditor : UITypeEditor { .... } public class CustomXYZEditor : XYZEditor { .... } } namespace MyNamespace2 { //I have an enum [Editor("MyNamespace.XYZEditor", typeof(UITypeEditor))] public enum XYZ { x,y,z } //And, I...

wpf pathsegment /line segment

I need to draw text along lines drawn through pathfigurecollection->pathfigure->linesegement is there any way to draw text along linesegment... or is there any way to resolve this. Cannot implicitly convert type 'System.Windows.Media.Geometry' to 'System.Windows.Media.PathSegment' ...

Synchronization primitive for shared usage counter?

Is there a Windows (or .NET) synchronization primitive that: can be shared across multiple processes on the same PC; represents a counter of how many threads are currently depending on a shared resource; is automatically decremented by the OS when a process abnormally terminates; and can be waited on by another process (and signaled wh...

Setting Pidgin status from .NET

Hello, Is there a practical way to set the global status message in Pidgin for Windows from .NET? Dbus is not available in the Windows version of Pidgin. Searching SO and the net has revealed helpful tips such as "rewrite libpurple in C#", which might be a bit beyond my time/enthusiasm level for this project at least... Thanks ...