.net

SSL with private key on an HSM

I have a client-server architecture in my application that uses SSL. Currently, the private key is stored in CAPI's key store location. For security reasons, I'd like to store the key in a safer place, ideally a hardware signing module (HSM) that is built for this purpose. Unfortunately, with the private key stored on such a device, I...

Find assembly's public key via code

How can I find a .NET assembly's public key via code? From the command line, I can use sn -Tp assemblyName to find the public key. What's the equivalent (c# or VB) in code? ...

Bridge between 64-bit and 32-bit application

What would be the best (easiest and fastest) way to provide an access between 64-bit application (ASP.NET) and 32-bit assembly (.NET 32-bit database driver). 1) I've got complete control over this two pieces of code (64-bit and 32-bit), 2) They both run on the same machine, 3) Security is not an issue, 4) Performance is important. ...

utterly weird behavior in basic string comparison

hi there, this doesn't make any sense to me. must be wrong or painfully obvious. after slicing and dicing, i got 2 vars with the following values in vb.net: strTag = "&lt;#<span class=SpellE>vermittler_person_Name</span>&gt;" tmp = "&lt;#<span class=SpellE>vermittler_person_Name</span>&gt;" comparing the vars gives a false: strT...

Is the null object pattern worth it ?

I was looking at the null object pattern and i am wondering if it worths implementing it or use "if" checks for nulls in my code intsead. As i looked at the implementations it seems hard to keep objects well synchronized with their null implementations. By making changes to the main object we have to check that the null object behaves as...

How should I "optionally" reference a Class Library project in another .NET project?

OK, so I have a .NET project that uses plugins. The plugins are implemented as Class Library (DLL) projects that each build in their own folders. The main project doesn't require the plugin DLLs to run, but if they are available, they are used for various optional functionality. Classes from the plugins are loaded by Type.GetType(). ...

How is an assembly resolved in .net?

How are assemblies resolved in .net. I mean, how is an assembly with a fully qualified name resolved. I am confused about the public/private key tokens and strong naming. Thanks EDIT: I have also read about delayed signing and stuff like that. Do people really use it? (Has anyone actually used delay signing) Who generates the key to sig...

Adding an entry to the Left-Upper-Corner Icon menu in WinForms?

I have a WinForms app, and I would like to add a menu entry to the menu that opens when the user clicks on the upper left corner of a window (the Icon) or presses ALT+SPACE. Form only shows me a MainMenu and a ContextMenu, but no Icon Menu or something like that. Is there a simple way to modify this on a WinForms app? I'm talking about...

ReaderWriterLockSlim implements single writer, or requires single writer?

I think I am having a brain fart. This sould be a very simple question: does ReaderWriterLockSlim IMPLEMENT the single writer concept, or does it REQUIRE a single writer thread? ...

Web Based Code-Review tools for Team Foundation Server

Our team is looking to start utilizing a code review tool. I have used many in the past and I am very fond of a few options that are available for SVN. However, we are using Team Foundation Server for source control and I have found there to be a real lack in options. So far, through searching, I have found SmartBear's Code Collabo...

Trying to maintaining a DataSet in WinForm App

I am in the process of converting an in-house web app to a winform app for disconnected reasons and I hit the following snag. In the Function SaveMe() on the webapp there is the following code on the Person.ascx.vb page --> //get dataset from session Dim dsPerson As Data.DataSet = CType(Session.Item("Person" & Me.Uni...

WM and C#: How to set up a WiFi Ad-Hoc connection programmaticaly ?

I am trying to build a Walkie Talkie application for a Windows Mobile 6 phone in C# using the .NET Compact Framework. I can't figure out how to set up an Ad-Hoc WiFi Connection programmaticaly. Does anyone know how to do that and what APIs to use? ...

In what circumstance does IE8 repeat words(text) in multilines textboxes?

This is a work question generalized so it can help other people with this nightmare. I deployed an ASP.net application on four PC Machines. This application asks them to enter data in many textboxes that are multiline as they LOVE to write. They are using IE8 with compatability mode that I have hardcoded into the httpheaders. The error ...

Determine number of files in a directory.

I need to determine the number of files/subdirectories in a directory. I don't care which files/directories are actually in that directory. Is there a more efficient way than using _directoryInfo.GetDirectories().Length + _directoryInfo.GetFiles().Length Thanks. ...

Using a single Func<T,bool> with Where() and inheritance

I'm trying to use a single Func<T,bool> definition to handle a class and its inheritor. This is what I have: Func<Job, bool> ValidJob = j => !j.Deleted && !j.OnHold && j.PostDate <= DateTime.Now && j.ExpireDate > DateTime.Now; public class JobExtended : Job { } So, given that, the following works: IQueryable<Job> jobs = ......

.NET control's event not working in COM on Windows Embedded for POS

I have an InteropUserControl in a .NET assembly that works fine in other operating systems such as Windows XP and Windows 2000. My company sells hardware along with the software we develop, and we get different types of all-in-one touchscreen workstations. Some All of one particular brand installed with Windows Embedded for Point of Sale...

How can I find a method caller when stepping through c# in visual studio 2008?

If I set a breakpoint on a method, how can I see what called the method, when the breakpoint is hit in visual studio 2008? ...

ASP.NET DropdownList autopostback and Browser Back Button

I have an asp.net Dropdownlist with autopostback enabled. It is not populated dynamically, its values are fixed in the HTML code : <asp:dropdownlist id="ddlReportView" runat="server" autopostback="True" onselectedindexchanged="ddlReportView_SelectedIndexChanged" enableviewstate="true"> <asp:listitem text="Snapshot" value="SNAPSHOT"...

DataGridView Sort

What actually happens internally when the user clicks a column header in a DataGridView? More specifically, if the first click sorts data ascending, how does it sort descending with the next click? Does it just negate the Compare() or CompareTo() result? And which interface does DataGridView use to sort items? ...

Is there a way to create a top level window besides Form in .NET?

Is there a way to create a Control that can display on the desktop without the use of Form? For example, displaying a splash window? I know that it's easy to create a splash window without any borders, etc. using Form. But that's just an example. I'd like to know if it's possible to create a top level window without all the baggage th...