.net

How Can I Let My Winform Work on a Single Machine Only?

I have winform application written in c#. I would like this application to only gets installed in a single machine e.g. M1. If a user tries to install the application in M2, he/she will get an error says "installation aborted due to .... etc". I will have to check MAC Address and Machine Name, if they match the one hard-coded in the app...

.NET application to write and build another application

In my constant strive to under promise and over deliver I'm looking to make a .Net tool to create simple .Net applications that the non-programmer superiors can use. How would I go about writing and compiling the code? Explanation of intent: I want my superiors to, rather than ask me to make a barcode label app, select a few options, do...

c# webproxy - a big adventure?

Hi @ll, since yersterday i play a little bit with the .Net WebProxy Class, because i think the usage of webproxys in one of the big traps in the development of applications with web access (my java experience). So i made a test case: i used a squid proxy without proxy authentication and defined the proxy settings in my "ms internet ex...

Creating a Custom Export to Excel for ReportViewer (rdlc)

I'm interested in creating a custom Export to Excel option for my Report in ReportViewer. This is mostly because I want pdf disalbed and I did that via: ReportViewer1.ShowExportControls = false; Since there is no way to disable any specific export functionality (e.g. pdf but not excel) in ReportViewer. Here's my (slightly) modified c...

Entity Framework on Windows 7

Our C# projects are developed in Windows XP with visual studio 2008 SP1 with .Net 3.5. We use Entity Framework with Sybase database. One of the sub-projects sharing edmx file with the main project. It works fine for long time. Now we are migrating our applications to Windows 7. we found that sub-project stopped to work for us, couldn't...

How to check if html elements are rendered in a single line in WebBrowser Component?

I am using the WebBrowser component to display a web page. I need to know weather a desired HtmlElement is rendered in a single line, .e.g a line that no other readable text resides in. I suspect that there is no method that will always work... HTML is to complex and there are a lot of IE versions. But there might be a good heuristic, th...

WCF Security; IAuthorizationPolicy called after ServiceAuthorizationManager

My understanding is that an IAuthorizationPolicy (added through my web.config) should be called BEFORE my ServiceAuthorizationManage.CheckAccessCore (also added through my web.config). (I also have principal authorization mode set to Custom in the web.config). This way, the IAuthorizationPolicy can add a ClaimSet, then the ServiceAuthor...

Where should I save an xml file so it can be written to by a service when Windows is logged off?

Hi all, Where should I save an xml file so it can be written to by a service (written in C#) when Windows is logged off? Thanks Steven ...

What thread handles modal dialog windows in .Net?

I have a pretty basic understanding of the GUI thread and the message loop, but I'm curious as to how that applies to one window starting a modal window. If I had to guess, I'd say that both windows are being run under the same GUI thread and that some parameter indicates that only events with the child window (the modal one) be executed...

Is there any way to xml serialize an anonymous type in .net using C#

Is there any way to serialize an anonymous type in .net? Normal XmlSerializer fails because the type has no parameterless constructor defined; and NetDataContractSeralizer fails becuase we can't tag DataContract or Serializable attribute to anonymous class. So is there any clever way around or we just can't do it? ...

Capturing all requests and responses from the web browser control?

Is there way to capture and print out all of the requests and responses from the web browser control including asynchronous requests? ...

Specifics about shifting floating point data types in .Net?

If I remember right, a double or float is broken into 3 parts: a sign bit, the exponent, and the mantissa. When a double is shifted, do the bits shift the entire binary of the variable or does it just shift the mantissa? ...

ServiceHost Efficiency

Hiya, Hoping you could help me please.. I am using WCF in my program. Part of this includes using ServiceHost in a self-service type scenario using a netNamedTypeBinding. When I include ServiceHost in my class and then instantiate that class (ServiceHost is set to null at this point), the memory usage increases by approx 9Mb. If I c...

Implementation of comunication between server and clients

Hello all I am looking for ideas of possible solution of my programming problem . I have a server pc and about 50 client computers , I should path a massages in both ways between the server and the clients . All computers sit on some local network , and the rate of massages between the server and client is really low . I though to im...

C# .Net double issue... 6.8 != 6.8?

I was doing some unit testing at work and a peculiar error popped up for one of the assertions. Note that expectedValue and actualValue are both doubles. Assert.AreEqual(expectedValue, actualValue); The exception stated that they were not equal, elaborating that "expected value: <6.8> actual value: <6.8>." The expected value is a har...

Save Memory in Windows application.

Hi. I have about 30 picture boxes in my form. all pictures are the same. how can i save memory in this case? for example define a picture and bind it to all picture boxes. to increase application size and Reduce memory usage. thanks. ...

Sharing Objects across WCF Services

I am having an issue similar to this question: Problem with WCF and Multiple Namespaces The major difference I am having is that I don't control both ends of the wire. My setup is similar to this: My.Objects My.LoginService My.Service1 My.Service2 The first thing you do is login via the login service and receive a security ticket. T...

Optimizing My Game App.

I want to create a game. Backgammon. i used to design my nuts and board in photoshop. i saved nut as png. and board as jpg. for per that i have in game i created a picture box , and i bound png picture to that. i know that this way is not correct. please give me tips and guidelines. seems my question is too general. i change my questi...

Can you hydrate a static property using MEF?

can I hydrate this inside the class's static constructor? public class Connect:IDTExtensibility2, IDTCommandTarget static Connect() { //hydrate static properties? } [Import] public static Action<ProjectLogicChecks> Display { get; set; } [Export(typeof(Action<ProjectLogicChecks>))] private static void Displ...

Calling a web service that requires basic http authentication from wcf client

Hi, I have a wsdl from a web service, I generated the wcf proxy. No problem. But I can not get my head around how to pass the user name and password. The webservice requires basic authentication - only username and password. Any help ? ...