.net

Specify cultures supported by application

Is there any way I can restrict my web application to certain cultures? So that .Net determines culture automatically, but the choice is restricted to these cultures. For example, I would like to support only 'en-us' and 'it', so all other 'en' language clients will automatically be assigned 'en-us' culture. UPDATE. I know how to set t...

What is the purpose of BlockingCollection(Of T)

Hi, I´m trying to understand the purpose of BlockingCollection in the context of the new Parallel Stacks on .NET 4. The msdn documentation says: Blockquote BlockingCollection is used as a wrapper for an IProducerConsumerCollection instance, allowing removal attempts from the collection to block until data is available to be remo...

Get permission from Authorize Attribute?

I've implemented my own Authorize attribute, and I notice that it queries to check permissions when I use [Authorize]. Is there any way I can get that permission and use it in the current controller that applies the Authorize attribute without having to rewrite and requery the code in the controller? ...

xsl format date (substring + concatenate ?)

I have the input <Date value="20091223"/> and I want the output to be <Date>23122009</Date> I was trying to use substring function to reformat the date <xsl:value-of select="substring($Date,1,4)"/> But how to concatenate the extracted year and months and day together. ...

w3wp.exe taking entire CPU

We have three websites hosted in our IIS, each one has a seperate App Pool associated with it. But I see the CPU spikes to 100 % when I request for a page the w3wp process takes 100% of CPU . Is there any solution for this ? ...

C# WinForms control in .Net COM Server won't redraw

Hi everyone, I have a COM server app which uses some WinForms controls which, frankly, do not seem to be redrawing when their properties (Text, BackColor, etc) are changed. I have tried invoking txtControlName.Invalidate() as well as .Update() and neither seem to be affecting anything. It is a business requirement that we stick to .Ne...

WPF VisualStudio's WatchList-like control

Hi all! I am implementig a simple interpreter and I am looking for a control to represent my variables in a watch list, just like in Visual Studio (tree structure + table): Do you know any controls for this purpose? If no, give some ideas how it can be implemented. Regards, Lerax ...

What does `Exporting a function from a DLL` mean?

I don't know much about dlls. I'm reading a book on COM. In which author is referring to something Exporting a function from a DLL. He tells how to do that but he doesn't tell what is it or why it should be done? The method he suggests is: a) mark function with extern "C" (don't know why?) b) create a DEF file and add the function names...

How to get Title, cookies, and post data for all tabs in IE

hey! I need a way to get Following data for all Tabs of IE : Titles of all Tab instances. Post Data when a form is submitted. All Cookies Actually my client wants to keep tab on his employees surfing behaviors, he has this requirement. I am not sure how i can do this.I guess it will be done in VC++/Delphi,Any technology will do as l...

Defining two dimensional Dynamic Array

How can I define two dimensional dynamic array?? If I want to use list,can I use it for two dimensional ?? ...

FormsAuthentication.RedirectFromLoginPage reload page

Hi, I am using the .Net memebership system, and uptil now I haven't had any real troubles with it. I now have a overlay where a user can create a profile. When the profile is created I just want to redirect to the same page, and not to the default page or the return url - which doesn't exists. I have tried to stop the FormsAuthenticati...

wcf duplex call through from host to guest under vmware (nat?)

i have installed an xp under vmware workstation and i can ping the guest with the adress 192.168.126.131 - so i've started a wcf duplex service, which works fine if i start srv and client under my host system (using localhost everywhere as path) - but if i start the service srv under the guest i can access http://192.168.126.131:18000/My...

ImageMagickObject with .Net

Hi folks, Still trying to resolve some image manipulation issues in .Net and I've come across ImageMagickObject.dll mentioned with some .Net projects - is this something usable with an application rather than a website? I have an .net application I'm trying to bridge with ImageMagick or one of its wrappers but not having much luck as my...

Defining two dimensional Dynamic Array with different types

I want to create two dimension array of different type like I can add to that array two values one of them is controlname and second is boolean value. ...

serialize HybridDictionary to byte[]

I wrote below code HybridDictionary state = new HybridDictionary(); using (MemoryStream buffer = new MemoryStream()) { BinaryFormatter formatter = new BinaryFormatter(); formatter.Serialize(buffer , state); _backup.Push(buffer .ToArray()); } but I got error ...

C#/.NET: Creating a CAB and adding files to it without an external library

I'm aware there is a similar question but the marked answer provides a link to an external library which requires several dependencies to be installed on the user's machine. I don't need extraction or anything else fancy like listing files - I only need to add the entire contents of a folder to a single cabinet file. I know cabinet.dll...

how to add new table to existing entity model without losing any customisation to model ?

I want to add a new table in my existing entity data model without using the option update from database. Because in this case i loss existing modification like inheritance and entity names. ...

Common Compile/Runtime Errors in ASP.NET MVC

What are some common errors that programmers face in ASP.NET MVC when compiling or running their application? Example The incoming request does not match any route Please include the solution with the error, or if there isn't one set solution, what developers should look for when encountering these errors. ...

Coverting an int to a different base. php, .NET

Hey I have seen sites that instead of an int show you a string. For example d2fr4st == 147392525 and d2fr4ss == 147392524. What base is this? And how can I do the same conversion in php and .NET? At the moment converting from 147392524 to d2fr4ss would be most useful. ...

Data Archiving [Design]

I am developing an archive module for an application using Dotnet and SQL Server as back end. From multiple approaches of archiving we've decided to build a custom application to archive the complete database up-to a chosen threshold to another mirrored database and then removing the archived items from source DB. This has to be done fro...