So, I'm looking for the most efficient way to sort a bunch of pairs<string, float> by value, because I need to get the 3 highest entries of a high number of pairs.
My natural reaction was to use a sortedList, but apparently it only sorts by key, and I cant use the reversed list solution because I know for a fact that the strings are uni...
I have built a Windows Service using VS 2008 targeting Framework 3.5. When I install and attempt to run the service on my workstation, it crashes with a .NET Framework error with the following details:
Event Type: Error
Event Source: .NET Runtime
Event Category: None
Event ID: 1023
Date: 2/5/2010
Time: 11:40:48 AM
User:...
I'm looking to expose specific .Net types to the IronPython runtime. I can do this:
ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();
engine.Runtime.LoadAssembly(typeof(Program).Assembly); // current assembly with types
But that exposes all types to the runtime. Is selective type loading possible...
Hi all
Is it possible to build a system or mail server/service to receive and parse it to extract the text in C#?
Does anyone do it before?
Best Regards,
...
I need to count sequential timeout exceptions from SqlBulkCopy. To test this, I use an external app to start a transaction & lock up the target table.
Only on the first call does SqlBulkCopy throw a timeout exception when expected. We've tried using an external connection & transaction, as well as using a connection string and internal...
I have a button click event handler which says this.Close()
In the FormClosing event I detect unsaved changes and say "Do you want to Save?"
If they say Yes I set e.Cancel = true and then call my Save method. If the data is saved ok in my Save method at the end I say this.Close() but the form stays open.
This seems such a simple idea...
I get a BindingFailure on a line of code using the XmlSerializer:
XmlSerializer s = new XmlSerializer(typeof(CustomXMLSerializeObject));
The assembly with display name CustomXMLSerializeObject.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNot...
What libraries are available to handle JSON in .Net? I've seen this: http://james.newtonking.com/projects/json-net.aspx but would prefer a native library, if possible.
...
here is my code
for(int i = 0; i < number ; i++)
{
MailAddress to = new MailAddress(iMail.to);
MailAddress from = new MailAddress(iMail.from, iMail.displayName);
string body = iMail.body;
string subject = iMail.sub;
oMail = new MailMessage(from, to);
oMail.Subject = subject;
oMail.Body = body;
oMail.IsBodyHtml = true;
oMail.Priority = M...
Hi everyone,
I have an ASP.NET MVC application, and in one of the controllers I have two long-running operations. I want to execute them in parallel.
At first, I simply rolled my own multithreading code by new'ing up a System.Threading.Thread() object, running it in the background, and thread.Join()ing it up before exiting the control...
Hi!
I've been looking for quite a while already and still couldn't find a solution for this.
All I need is to retrieve the memory levels and percentage of use.
OpenNETCF has a MemoryManagement class, which seems to encapsulates a data structure returned through a P/Invoke or something like that, and it gives me the TotalPhysicalMemory, ...
What do I need to do in either my C# code or my XML document so that the XDocument parser reads literal whitespace for Values of XElements?
Background
I have an XML document, part of which looks like this:
<NewLineString> </NewLineString>
<IndentString> </IndentString>
I'm adding the values of each XELement to a...
I am designing an app using .NET 2.0 remoting. It has a single server and multiple clients which are workstations or laptops which may be on or off-line at any time.
Part of the design is that the server holds a copy of the client installer MSI. The plan is that for the first installation, the clients will be rolled-out using group poli...
I am working on writing some code to scrub user input to my ASP.NET site. I need to scrub input to remove all references to ASCII characters 145, 146, 147, 148 which are occasionally getting input from my mac users who are copying and pasting content they write in a word processor on their macs.
My issue is the following three strings I...
Supposing I built an assembly with a single class:
public class Foo
{
public void Bar()
{
// If we're being called from IronPython, IronRuby, etc... do one thing
// If not, print some message. Or something.
}
}
Then, from ipy.exe:
import clr
clr.AddReference('ThatAssembly.dll')
from ThatAssemblyName...
If I use the ThreadPool in a nested way, my application hangs:
ThreadPool.QueueUserWorkItem((state) =>
ThreadPool.QueueUserWorkItem(Action));
How to get a second and independent ThreadPool to achieve nesting?
...
I've just compared the Delphi 2009 VCL/RTL code to the 2010 one.
I noticed that there are many $IF DEFINED(CLR) conditional defines and they got more in the 2010 version.
I thought that these conditional defines have fall into disuse, since Delphi .NET has been discontinued. The VCL/RTL aren't really used in Delphi Prism? Or are they?
...
I've been using System.Diagnostics.Process.Start(). For example:
string target = @"c:\te=mp\test";
System.Diagnostics.Process.Start("explorer.exe", target)
The target variable is actually supplied more dynamically and does on occasion include an "=" sign which is a legal character in filenames and directories.
The issue is that this...
So in my case i am doing discovery of the structure of a class using reflection. I need to be able to find out if a property is an auto-implemented property by the PropertyInfo object. I assume that the reflection API does not expose such functionality because auto-properties are C# dependent, but is there any workaround to get this info...
For a school project, we need to create a fairly simple app using C++ and .NET framework. I only know C++, but we need to produce a working executable file for the project. The prof said we can use WYSIWYG editors for the GUI, but i can't seem to find one in Visual C++. I wanted to code with Visual C++ since i want to learn about Visual ...