.net

Invoke Windows Certificate Export Wizard .NET

Hi, Does anyone know how to invoke/display the Windows Certificate Export Wizard Programmically within C#.NET whilst providing an X509 Certificate? Many thanks ...

Finding .NET Multithreading Bottlenecks

Greetings. I have a .NET application running a bunch of simulations in parallel. It's doing a parameter sweep, so each parameter has its own Parallel.Foreach loop. I normally set the max parallelism to one in all but one of loops, to keep memory requirements down, since each parameter can take more values than I have cores available (4)...

Formatting a negative TimeSpan

I'm doing some math with the Timespans in .Net, and occasionally the sum results in a negative Timespan. When I display the result I am having trouble formatting it to include the negative indicator. Dim ts as New Timespan(-10,0,0) ts.ToString() This will display "-10:00:00", which is good but I don't want to show the seconds so tri...

How to P/Invoke CryptUIWizExport Function using .NET

Can anyone translate these two cryptui.dll functions/structures into C#.NET [dllimport] wrappers? I would like to P/Invoke the CryptUIWizExport function to display the Windows Certificate Export Wizard. In particular, I need to pass a .NET X509Certificate as a parameter into the CryptUIWizExport function. You help is much appreciated!!! ...

File will not decrypt properly

Ok so at this point I've figured out many of the other issues I was having. Now upon attempting to decrypt the file, I receive no exceptions, however the data is not decrypted properly....it goes through the entire operation without throwing an exception, until I attempt to access the XML document via the combo box again after decrypting...

TaskKill for killing .NET console application

I have a bunch of console host applications hosting WCF services. I'm calling a .bat file as a pre build step to kill any running host instances so that I don't get WCF channel registrations errors(manually killing the console hosts each time before a build is a royal pain). The .bat file I've created contains the following. taskkill /...

How to add custom object to DropDownList Items?

Hi, I'm using DropDownList within my WebApplication. I need to keep additional piece of information with each Item on list. How can I achieve this? ...

Life cycle of .NET automation server called from Excel over COM

Like the subject says, I wrote a C# class, say Test, then compiled it as a DLL and exposed it to Excel as a COM automation server. Now, you can call the methods of that class in Excel formulas either directly or through a VBA function that itself calls them under the hood. What happens in the second case is relatively transparent (you wr...

.NET WinForm ComboBox - How to alter the DropDown behavior

I've got a fairly long list in a ComboBox, and I want the DropDown behavior to be different. Normally, when you click the arrow, the list expands showing all options, starting with the selected option. Options listed above the selected option are hidden, but can be seen by scrolling up. I want the list to scroll up a bit, showing the s...

dll export/import problem in visual studio 2010

I am wrote a visual c++ win32 console app, and i wrote it and tested it in win32 console project . then i switch to win32 project and imported all the source files and created a dll for it. by mark the class i want to export as #define DllExport __declspec( dllexport ) class DllExport theClass { } it works and the d...

Is there a way to overload Items.Add procedure in inherited class from DropDownList?

Hi, I have my own custom class which inherits from DropDownList. Is there a way to override Items.Add procedure? How? ...

super minimalist plugin for MS Project: where to get started?

Howdy I was wondering if you could point me in the right direction as far as developing a super simple plugin for MS Project (both 2007, which uses the old style ribbon, and 2010 which uses the new ribbon). What I need to implement: create an executable that installs a new button, with a specific icon, in some per-determined section ...

Fitnesse with .NET gets mysteriously stuck when running suites

( Of course I can state this is "mysterious" because I have not been able to identify the problem. I am hoping it will be obvious to one of you erudite readers and that you can enlighten me :-) Running a single fitnesse test in my browser (FireFox or IE) works fine, but when I run a suite of tests or a suite of suites, Fitnesse just sto...

Entity Framework - Model generation Error: ''', hexadecimal value 0x1F, is an invalid character.

Hi community, my Entity Data Model designer gives an error, with the following message: "''', hexadecimal value 0x1F, is an invalid character." This error comes not from all database tables. Only one table of my database produce this error, but the very strange behavior is, the error table is not allways the same one (but always altern...

Using Linq to return each item only once.

Here's what I'm trying to do. Have a use right a sequence of numbers delimited by spaces. After I save those numbers, I want to return a string of all the numbers only once, even if a number has appeared n number of times in the sequence. string[] tempNumbers = textValue.Split(' '); IEnumerable<string> distinctNumbers = tempNumbers.Whe...

Algorithm to find the 2 largest numbers smaller than 2 integers a and b, that are divisible by each other.

So here’s the challenge. Given 2 integers named a and b: // Find the 2 largest numbers, smaller than a and b, that are divisible by each other. // input: a:102,b:53 // output: (102,51) // input: a:7,b:4 // output: (6,3) // input: a:3,b:2 // output: (2,2) The catch is, I don’t want to brute force it. I think it comes out to O(n²)....

Drop items into specific group in a listview

I'm trying to drag an item between two Groups in the same ListView called 'listTasks'. Private Sub listTasks_ItemDrag(ByVal sender As Object, ByVal e As ItemDragEventArgs) Handles listTasks.ItemDrag listTasks.DoDragDrop(listTasks.SelectedItems, DragDropEffects.Move) End Sub Private Sub listTasks_DragEnter(ByVal sender As Object, By...

I seem to have fallen into some massive, massive trouble with NullReferenceExceptions.

Recently I'm developing a software that parses and displays XML information from a website. Simple enough right? I'm getting LOADS of NullReferenceExceptions. For example, this method: private void SetUserFriends(List<Friend> list) { int x = 40; int y = 3; if (list != null) { foreach (Friend friend in list) ...

Is there a HTML code beautifier?

I would like to beautify my HTML before it hits the user's browser. Is there any free or open source libraries that do this? ...

Run function every day at fixed time

I am developing an application in .net. At one point I have to make a function that runs at a fixed time every day. I don't want to use Windows service. Is there any other way that I can make this work? ...