.net

How can I copy a file as a "Standard User" in Vista (ie "An Administrative Choice Application") by prompting user for admin credentials?

I have what the UAC Development Guides refer to as a "Administrative Choice Application." If you're familiar with what this is skip to the next section. Background: I want to let a "Standard" user have the ability to select/deselect a Run On Startup option in the preferences for my application. Since my application is per machine (no...

Calling .Parent from a form causes textbox problem, MDI

I want to make a form contained in another form. The problem is the application is already a MDI, and you can't nest MDI's. If I do childFrm.Parent = parentForm some controls behave oddly. For example, if you click on the text in the textbox, usually the text cursor appears where you clicked, but it doesn't, it just goes to the end o...

XML file interpretation and manipulations

<?xml version="1.0" encoding="utf-8" ?> <root> <MyData> <MyField>SomeValueHere1</MyField> <MyComplexData> <MyComplexDataField1 property="1"></MyComplexDataField1> <MyComplexDataField2 someproperty"value1"> value1 </MyComplexDataField1> </MyComplexData> </MyData> <MyData> <MyField>SomeValueHere11</MyField...

run application on a dual screen environment

Hello everyone, Any ideas to check whether current application is run on primary screen or not in a dual screen environment? I am using VSTS 2008 + C# + .Net 3.5. I want to add code in my application to detect whether current application is run on primary screen or not. thanks in advance, George ...

Is it possible to create a new operator in c#?

I know you can overload an existing operator. I want to know if it is possible to create a new operator. Here's my scenario. I want this: var x = (y < z) ? y : z; To be equivalent to this: var x = y <? z; In other words, I would like to create my own <? operator. ...

Programmatically sending "net send"

Ok, I can't seem to get the search right so here I am. I'm trying to figure out how to write a method to not use the System.Diagnostics.Process class and still send messages to other computers as if it's from net.exe but it isn't. If it matters, I'm writing an all-in-one framework for my workplace and combining key features we use into ...

SecurityException(Partial Trust) running Workflow from Windows Forms Application

I'm trying to make use of a sequential workflow console application being called from a windows forms app. When the project runs and I click on the button that would create and start the workflow I get I get SecurityException was unhandled That assembly does not allow partially trusted callers. I'm calling classes that I call in my .ne...

Sockets Vs. WCF

Hello, I work on a chat-like application, where I use Silverlight on the client side and wpf on the server side. Right now the communication is based on Sockets: I have different Message-Classes which I serialize and send via TCP. I start realizing that creating a seperate Message Class for each possibile communication scenario is quit...

.NET assembly binding failure (different versions with a redirect), weird!

I'm trying to troubleshoot an application built against version 9.1 of a vendor's libraries on a machine that has their 9.3 version installed. The vendor provided a publisher policy file that redirects all versions from 9.0 onwards to their 9.3 dlls, and it is installed in the GAC. With a newer version of our application, built against ...

Advice with Dynamic Forms in ASP.NET MVC

I am working on rendering a dynamic form in an ASP.NET MVC view that will meet these requirements: Fields can be validated State is preserved when the form is invalid I am looking into creating a custom model binder to achieve this. I am generally planning to do this: Form fields are defined with these properties Prompt (label nex...

How to overcome <customErrors> error in a .NET remote hosting environment?

I am hoping that someone around here already confronted this error and is an easy fix. We are unable to see the real error, and we have done all that we think we can do. Any ideas, apparently we cannot see the error because of security. We are always able to setup hosting internally but we want to avoid that. Any ideas? The screensho...

hint for audit log approach

Hello! I'm currently developing an ASP.NET Human Resources System. I'm using a layered architecture with Web Client Software Factory, which is based on MVP pattern. ORM is NHibernate. And I need to implement an Audit Log module. I've read a lot about different approaches. Most of them describe how to track date, timastamp and identity of...

Rhino mocks - assert method was called with given parameter

My test method look like this: [Test] public void Generated_CaseNumber_should_be_set_as_LastCaseNumber_in_PropertiesManager() { String generatedCaseNumber = _sut.NextCaseNumber(); } _sut object has a dependency to mocked object of type IPropertiesManager. Method _sut.NextCaseNumber() should generate un...

Server side event confusion with ASP.NET

I am attempting to create a web page that will allow a user to capture images from a camera attached to the server using ASP.NET. The camera is an olympus and the server side code has access to all of the synchronous calls that are in the sdk of the camera. The problem arises when I attempt to capture an image. The way it works in the ...

C# Windows Form .Net and DOS Console

I have a windows form that executes a batch file. I want to transfer everything that happends in my console to a panel in my form. How can I do this? How can my DOS console comunicate with my windows form panel??? Thanks ...

C# get digits from float variable

Hi I have a float variable and would like to get only the part after the comma, so if I have 3.14. I would like to get 14 as an integer. How can I do that? ...

Creating controls in a non-UI thread

I have a sort of plug-in model in which various complex user controls are stored in DLLs and loaded and instantiated at run time using Activator.CreateInstanceFrom(dllpath, classname). Since I'm loading quite a few of these I wanted to do it in the background, keeping my UI responsive, by creating a new thread to do the loading. The ...

Yahoo "White Screen" with WebBrowser object

Using the Microsoft .NET WebBrowser control sometimes leads to a White Screen. Yahoo.com is a great example of a website that does that depending on your IE settings. I have found that by changing the Internet Options in Internet Explorer, those same settings will affect the WebBrowser object as well and make it possible for the WebBro...

.NET - vs EJB

What is the comparable technology of EJB (Enterprise Java Beans) in .net? ...

Pass current transaction or use DependentClone?

I have a WinForm application which uses SqlServer CE 3.5 as database. I use typed dataset queries for db operations. I need to use transactions for this operations. The problem is, they're scattered across different assemblies. My question is, what should I use to run all of them in a single transaction? Here's an example operation: //t...