.net

What's a global method?

What is a global method in .net? I'm talking about the ones created by the ModuleBuilder.DefineGlobalMethod method. Can these methods be called from C# or other .net languages? ...

How to implement publish/subscribe communication over the internet

I have a .Net service hosted on a server, and .Net clients connecting to this server over the internet. I want to implement a publish subscribe model where clients can subscribe to events on the service and have data pushed to them as data becomes available. An alternative would be to have clients poll the server for data, however this ...

what is version of an assembly?

i am confuse with what is version of an assembly? ...

MAC address in PHP/JavaScript/.NET ?

How can I get MAC address with using PHP, JavaScript and .NET ? ...

What WPF control or approach for this requirement?

Just being new to WPF I"m not sure what control or approach would be best for this requirement, for a WPF application. I want to present a summary table of information, but the user should be able to decide to view the information based on either: "All Time", Month, Week or Day. I'd like to visually have the selection of the option a...

How native is OpenCL in Java?

I see there is an OpenCL binding for Java. Does this enable one to truly program in Java, using CPU / GPU etc. as processing cores, or does it merely give Java apps access to C++ OpenCL enabled methods? Out of interest, is there an OpenCL binding for .Net? ...

net: business entity?

hi all I would like to know that what considerations we need to do when designing business entities as a software architect? Any reference or help is appreciated. ...

Programmatically opening the CD tray

I want to program a small program in c# in windows that would open the CD drive tongue - eject the CD if there is one. I'd like to know where do I start and what .net libraries deal with this isue. Thanks ...

How to correctly canonicalize a URL in an ASP.NET MVC application?

I'm trying to find a good general purpose way to canonicalize urls in an ASP.NET MVC 2 application. Here's what I've come up with so far: // Using an authorization filter because it is executed earlier than other filters public class CanonicalizeAttribute : AuthorizeAttribute { public bool ForceLowerCase { get;set; } public Can...

open WCF svc file error in IIS

Hello everyone, I am using VSTS 2010 + C# + .Net 4.0 + IIS 7.5 + Windows 7. When I open a WCF svc file in IIS 7.0, there is some error like this, any ideas what is wrong? System.BadImageFormatException: Could not load file or assembly 'foo.test' or one of its dependencies. thanks in advance, George ...

how to change button text using static function?

Hello, I need to change a button text using an static function. static string[] ARRay = new string[10]; [STAThread] static void Main() { string[] args = Environment.GetCommandLineArgs(); for (int i = 1; i != args.Length; ++i) { command(i.ToString()); ARRay[0] = i.ToString(); } Application.EnableVisu...

WPF: Show custom Preview-picture for video (MediaElement)

WPF: Show Preview-picture for video (MediaElement)I've got a video as a MediaElement <MediaElement Name="video" LoadedBehavior="Manual" ScrubbingEnabled="True" Loaded="MediaElement_Loaded"" Source="Resources\blickpunkt10.mp4" /> I want to show a custom picture while the user didn't tap the video. How to do this? ...

How do I round down a decimal to 2 decimal places in .Net?

This should be easy, but I can’t find a built in method for it, the .net framework must have a method to do this! private decimal RoundDownTo2DecimalPlaces(decimal input) { if (input < 0) { throw new Exception("not tested with negitive numbers"); } // There must be a better way! return Math.Truncate(input * 100) / ...

protobuf.net Unexpected subtype

I'm encountering this Exception in my project using Protobuf.net: InvalidOperationException "Unexpected sub-type: foo" I have a class which I'm sending which looks like this: class message { list<bar> listOfBars; } foo inherits off bar, However protobuf seems to choke on this and generate the exception above. Is there some way ...

C# strudel sign

While coding in C#, I by mistake added a strudel sign before a variable in if statement (instead of exclamation mark). bool b = false; if (@b) { } I surprised it compiled successfully without any error. I wonder: What is the meaning of the above code? ...

Cannot run mspec.exe with Syste.Data.SQLite.dll x86, but it works in R# MSpec runner

Hi, I use mspec for my tests and have a NHiernate Setup using SQLite x86 for my database in the tests. The problem is that when i run my test using the mspec r# runner everything works fine but running it from the console thwors an error that it cannot find the sqlite dll. My config of the specification projects: .net 4 x86 (using th...

how to create c++ programs without the requirement of .net framework to run (like ccleaner and utorrent)

i was wondering how programs like ccleaner and utorrent are made? AFAIK they are written in C++ but they run without the need of .net framework and apparently run on windows 98 as well. How can this be done? Visual c++ requires .net framework to be installed to run the binary file. While .net framework is free, it can be a hassle and i...

NServiceBus with Unity 2.0?

Anyone using NServiceBus 2.0 successfully with Unity 2.0? I've tried to compile sources of NServiceBus.ObjectBuilder.Unity.dll against Unity 2.0 assemblies but got several compile-time errors because of changed/deleted signatures of many object methods in new Unity. In the documentation Udi Dahan says that attaching any container is a...

Windows app to get XML data from a website containing XML data

I am trying to come up with a windows form application (or WPF) developed in C#.The requirement for my app is to get user search related xml node data from a website containing xml. The application would connect to a website containing xml and grab relevant xml nodes from the website. I would then display the xml node data on my windows ...

How to collapse a paragraph?

How can I make a Paragraph collapsible in a FlowDocument while keeping its text selectable? ...