.net

Start non-elevated process from elevated process

Hi My program running as an elevated process, and starting new processes with Process.Start(). For security reasons, I would like to run those new processes as non-elevated. How to do that? ...

Adding generic properties to an object without having to cast them later?

I have an object, MySession, that has a hashtable for storing arbitrary properties with arbitrary types. The relevant part of the object definition is: public class MySession { private Hashtable _sessionVars; /// /// Set and retrieve session variables ala the traditional session managers. /// So, SessionObject["var1"] ...

Aero arrows using native hacks?

Using some P/Invoke, one can create a command link from a button in .NET (see http://blogs.msdn.com/b/knom/archive/2007/03/12/command_5f00_link.aspx). I was wondering if a similar procedure was possible for the Previous/Following arrows visible in, for instance, Aero wizards or the Aero Explorer. I know I can extract the files myself...

Reflection - Can't create a new object instance C#

I am trying to create a plug-in type archetecure for my project. I would like the ability to load an assembly, get a type that is derived from an abstract base class in my project, instantiate it and load that derived type into the main processing object. My problem right now is that when I instantiate the object from the reflected ass...

What is crossplatform Java analog for Windows SetProcessClass?

How to set my process PriorityClass to "realtime" on windows (xp and later is in my main intrest) and its analogs on Lin? What is crossplatform Java analog for Windows SetProcessClass? ...

How to get the next available primary key from a SqlCe DB ?

How can I get the next available primary key from my table? The primary key is a numeric. I'm using C#. ...

.Net WCF RIA Services: To page or not to page? and how much data to send down the pipe.

So I was having a debate with my co worker about WCF RIA Services, and exactly how much data we send to the client in a given request. Here is the setup: We are creating a reporting application in Silverlight and grabbing data from a WCF RIA Service to populate various grids and charts. We have two differing ideas as to how to implement...

Calling a Java web service using server authentication from .net

I have a web service I want to call: https://someserver.com/Service The service is built on a IBM WAS server in Java. It is using SSL authentication so on the WAS server a certificate was created and they sent us the public .cer file and a WSDL file. On my side I have a .net application that is set up based on the WSDL file to consum...

c# calling back to main thread

Hi, I'm in a static class in a background thread , but i want to create a new GUI component, to do this i need the main thread of the application to executing the method. How can I do this? [note i dont think i can use InvokeRequired as its a static class not a gui] David ...

How to create generic method

Hi All, I want to create a method which will take some base type as a parameter and compares and check if it is derived type and return the derived type based on that. For Example: Class A : IBase Class B : IBase My method: Public IBase GetData(IBase type) { If type is A then { //do smthing return A } If type is B { ...

Autofac - Service constructor takes reference to instantiating object.

How do I deal with: Current code looks like; class Class1 : ISomeInterface IFooService _service; void SomeMethod(){ _service = new FooService(this); ..... } class FooService : IFooService public FooService(ISomeInterface class1Implementer) { _class1Implementer = class1Implementer } I want...

Validation windows application

Hello.. i would like to know which is the best way to inform the user about his mistakes when entering data... Show messagebox describing the first found error? red the textboxes etc? showing messages on the form(avoid messageboxes)... ...

C# .NET: Turning TabControl into Wizard

From what I read on MSDN, TabControl is seemingly the wrapped version of property sheets. (About Property Sheets on MSDN). Now sending messages to the property sheets, one can apparently turn them into an automatically created wizard: (Creating Wizards on MSDN). My question is: Is there a way to send those p/invoke messages to our TabC...

Dynamic LINQ GroupBy Multiple Columns

I need to translate the following LINQ query to Dynamic LINQ that accepts several grouping columns based on user input. Basically I have a bunch of dropdownlists that apply groupings and I don't want to enumerate every combination of groupings. If Dynamic LINQ fails, I may have to construct a SQL query manually, and nobody wants that. ...

Equivalent of Win32's ________ in .NET

I recently needed to find the .NET equivalent to ShellExecute, and I was happily able to find the answer quickly at StackOverflow. But surely there must be document or a list somewhere which would have given me this answer just a little quicker. Back when I went from ANSI programming to UNICODE, Microsoft had this handy page of routine...

Newb: Update XAML Image Element During Runtime (WIndows Phone, .NET 4)

Greetings all, Thanks for reading and sharing any insights. I've created a new simple Windows Phone 7 application. I have two Image objects on the form I would like to update with various .png files. I have included the .png files into my project, and I believe I am building proper URi resources pointing to these files. Uri myImage1UR...

Simple SQL DAL for 4-5 queries

I have to gather data from a sql database to populate a ning map i am creating. I only need data from one table in the database. The table has company data in it, name country state, email, website, etc. What is the best way to do this? I am doing my bing map using .net so i was thinking of just gathering all my data in code behind i...

Visual Studio 2010 Mixed Mode .dll fix not working for me...

So I am getting the same exception as a lot of other people when I am trying to run an execute statement into my SQLite database in my Windows Forms project in Visual Studio 2010. The exception reads: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional confi...

Entity Framework 4 , Extending context of one edmx file to a context of another edmx file

My Question is can we extend one context to another in Entity Framework 4. Following is the problem background. I am using EF4 for developing a Web-Application. My Web Application has 3 projects. One project is for storing candidate CV information. Another project is for storing customer information. Final project is called CORE. t...

.net parsing web page (ssl,capicom)

Here is the deal, i have key token on flash drive, i can access web page i need via browser, now i need to parse page from my winforms application on c#. By httpresponse and request i get error page. Webpage is using capicom for authentification. How can i parse such page? ...