Change the behavior of the application based on the entire URL

This might sound like a strange one. I'm hoping to have two identical instances of an application behave differently based on the URL used to access them. I have two instances of the app deployed on IIS, let's call their paths dev.routeone and

Get a full path on the Sitecore element deletion

Working with Sitecore 8 Update 2 I've added some configuration and the code to capture the event when an item is deleted. I want to get the full path of the item but all I can get is [orphan]/{itemName} ( where {itemName} is the itemName, but it alwa

C # - List Lists

I would like to create a multidimensional list with the following data How do I initialize the list and a new class? I am trying to do the following but when I start adding data how can I link a tyreID to a vehicleID? Should I create two classes? pub

How do I degrade .net from 4.5.2 to 4.5

I'm trying to switch the Target Framework on one of my projects from 4.5.2 to 4.5 (the computers we're installing on only have .net 4.5 and IT won't let us update to 4.5.2) I'm using Visual Studio 2015 I've switched the Target Framework in Properties

Search for OpenXML tags

I'm writing a .NET application that should read a .docx file nearby 200 pages long (trough DocumentFormat.OpenXML 2.5) to find all the occurences of certain tags that the document should contain. To be clear I'm not looking for OpenXML tags but rathe

Prevent application of closure

I created an empty project in Visual Studio and added the required assembly references, a class with a static Main function and a WPF Window. I then create an instance of the Window and show it, but after execution everything closes as there is nothi

Clickonce Wpf Embed .NET 4.5

I have a ClickOnce Wpf application which needs .Net 4.5 to run. My users are all over the country (about 60 of them) and organizing admin rights for each pc is going to be a very difficult task. Is there a way to embed .Net 4.5 into my application so

BackgroundWorker thread problem

I'm getting the infamous "Cross-thread operation not valid" exception when trying to implement a simple BackgroundWorker. I've spent hours reading everything I can find on the subject, including the many related questions on SO, but I'm just not

How do I get and use the current exe directory?

This code works: Public Sub Install() progDirectory = ) My.Computer.FileSystem.WriteAllBytes(SelFolder & "\", My.Resources.Resource, False) Unzip(SelFolder & "\", SelFolder) End Sub But this does not: Di

Combined box element selected null and display of the DB value

I have a combobox cboPrePartNum with: Data Source - prepartBindingSource Display Member - PrePartNum Value Member - PrePartNum Selected Value - engordbindingsource - prepartnum When the form loads this is run: private void LoadComboBoxes() { List<Par

Double selection in the list

How can i select name in list? which is itself in list??? My struct: public class Item { int id; List<Name> names; } public class Name { int id; string name; } List<Item> Items; code: Items.Select(a => = 1) //whats next Assuming you wa

Windows Mobile - Attach start and save a call

I need to implement a small feature in my project for windows mobile 6.0+ platform. I want to attach to an event when a phone call is answered and to record the 2 way call. I saw this question: Windows Mobile - 2 Way Call Recording (C#) But it doesn'

How to convert a rollover version to a byte array

i need to convert the string representation of rowversion column in sql server 2008 to byte array using c# String rowversion = "0x000000000001265E"; i want to convert this to byte[] any idea ?try this String rowversion = "0x000000000001265E

How do I open an Excel file in an Excel object in .net?

I must to import information from Excel Spreadsheets into a .net object to read and store some data. I did the importing of namespace and I know how to create Excel objects. But I don't know how to set the file (loaded through a FileUpload object) to

UCX VoiceXML error when deploying on server

I have deployed a sample project to a Windows 2008 virtual server that does not have any audio set up. I have installed the UCMA 3.0 runtime. This application runs on a Windows 7 64 bit development laptop. I am receiving the following exception. Erro

Why exactly did the regasm warn me to sign with a strong name?

If I want to make a .NET assembly usable as a COM server I have to add a set of attributes and then use regasm to register it as a COM server. If the assembly is not signed with a strong name regasm when run with /codebase key shows a RA0000 warning

.NET Remoting and HttpContext.Current

We have a plugin system where the plugin code runs on a separate AppDomain from the main process, using .NET remoting for the objects to communicate. One class is similar to HttpContext.Current (which also suffers from the problem) (edit, the actual

.net thread safety

Why is locking a type considered very bad? For example, lock(typeof(DateTime)) I understand that static methods of any class in .net is considered thread safe, and that instance members are not. So it isn't necessary to lock DateTime while you are us

Programmable RAM Disk API for .NET?

Looking for a RAM disk API (or equivalent set of software to implement) to store file/s temporarily for read/write operations outside the physical hard disk environment. update Exe files will be written to the RAM disk and executed.A "RAM disk"

How do I control WCF logging from a log4net configuration file?

We do all our logging with log4net, our support staff etc know how to edit the log4net config files. We are now making use of WCF in our apps. Therefore how can I enable the WCF built in logging to be controlled from the log4net config file, so that

Making the XSLT language independent

In my web application, I display the search results using XSLT. There are some hard coded text in XSLT file which I want to make language independent. XSLT: <xsl:if test="$IsEmpty"> <table cellpadding="5" cellspacing="0&q

Deposit model, sharing connections

I've found lots of examples of the repository pattern, all of which show the repository managing it's own connection lifecycle. I was wondering how people deal with a case where they want to share a single connection across multiple repositories? The

.Net 2.0 - ControlPaint.DrawButton uses bad color

When I call ControlPaint.DrawButton, the button that is drawn is in the non-themed background color. How do I draw a control that looks like a button (including themed drawing) in .Net 2.0 (C#)?The ControlPaint methods do not support visual styles, t