.net

Does calling a method on a value type result in boxing in .NET?

I was just participating in this question: http://stackoverflow.com/questions/436211/is-everything-in-c-an-object And one poster (in comments of accepted answer) seemed to think that performing a method call on a value type resulted in boxing. He pointed me to this article which doesn't exactly specify the use case we're describing. I...

How to define a constant globally in C# (like DEBUG)

I want to compile a project differently, according to a constant defined by #define, like this: #define USE_COMPONENT_X #if USE_COMPONENT_X ... #endif and I can do that in C#. But when I go to another file in the same project, this constant is not defined. Can I in some way define a constant to all the project, like DEBUG is defined...

When an inherited class is instantiated with the default constructor, does it call the base class consctructor as well?

Does anyone know what is the behavior for C#? Is it the same for all .NET languages? ...

How to SendKeys F12 from current .NET form/application

I am pretty sure the following button-activated form code should raise a Control-F12 in my C# application: SendKeys("^{F12}"); But it does not appear to go on up to the windows shell and activate another program that is listening for it. My keyboard does work. It seems like the sendkeys is getting intercepted somewhere and not sent o...

Formula parsing / evaluation routine or library with generic DLookup functionality

I am writing a .Net application where I must support user-defined formulas that can perform basic mathematics, as well as accessing data from any arbitrary table in the database. I have the math part working, using JScript Eval(). What I haven't decided on is what a nice way is to do the generic table lookups. For example, I may have a...

.NET MapReduce Implementation

Does anyone out there know of a .NET (or at least Windows) based implementation of MapReduce? We're looking for an easy way to distribute load for our C#/ASP.NET webservices. We looked at Hadoop, but it says specifically that it hasn't been tested in a production environment on Windows, which is somewhat disconcerting. ...

Can I bind multidimensional data to a DataGridView in C# and .NET?

I'm looking to develop an app which features worksheets subclassed from DataGridView. Users can paste (or import) CSV-like data into the worksheet and it will be reflected in a data structure in memory - my first guess would be a 2D array of floats. DataGridView can be bound to objects with a certain set of interfaces (i.e. IList, ILis...

Send broadcast message from all network adapters

I have an application that sends broadcast messages and listens for response packets. Below is the code snippet. m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, 1); m_socket.Bind(new IPEndPoint(IPAddress.Any, 2000)); ...

Who's on Dictionary<>.First() ?

What is the meaning of the .NET 3.5 extension method Enumerable.First() when you call it on an instance of the Dictionary collection? Does the set of keys determine which item is first, or is it just not defined? ...

How do I hide a console application user interface when using Process.Start?

I want to run a console application that will output a file. I user the following code: Process barProcess = Process.Start("bar.exe", @"C:\foo.txt"); When this runs the console window appears. I want to hide the console window so it is not seen by the user. Is this possible? Is using Process.Start the best way to start another con...

.NET app.config question

I have created an Excel 2003 add-in that uses the CLR 2.0 and this add-in is to be installed in hundreds of machines at my customer's site. The issue is that some of the machines where the add-in is installed have .NET 1.1 and .NET 2.0 running side by side, and the plugin throws an error when it's trying to load. The solution I have co...

Running C# app 32 bit on 64 bit machine

How do I force my app to run 32 bit on the 64 bit machine? The code is written in C#. ...

Are there any SyncML server components that work in .NET?

Basically we'd want to create a SyncML server that we can hookup to our own custom data source, all the component would do is listen for client connections and notify and request data from our code return the data back to the client. Looking primarily to sync Contact data from our app with various mobile devices. ...

.NET: Possible to change XPath() expression based on URL parameters?

I'm setting up a simple page that just displays the contents of an XML file and allows the user to filter by keyword. I'm a serious .NET newb, but I've got an XmlDataSource set up: <asp:XmlDataSource ID="RSSFeedDataSource" runat="server" DataFile="test.xml" XPath="/rss/channel/item[contains(title,"theKeyword")]"></asp:XmlDataS...

F# as a Scripting Language

Is there a good way to write F# scripts that execute stand-alone without compiling? ...As scripts that could be executed via task scheduler on a server? I assume the server would have the core F# libraries, but not Visual Studio installed. Is there an F# equivalent to CS-Script or NScript, but not a hack (workaround). ...

Performance counter for "Largest free region"?

I'm debugging an out-of-memory exception. When I get the exception, the "virtual bytes" performance counter indicates plenty of addressable space. The problem, however, is that the addressable space is badly fragmented, and the "Largest free region" (returned from !address in WinDbg) is too small. To measure the memory fragmentation, ...

Execute multiple command lines with the same process using .NET

I'm trying to execute multiple commands without create a new process each time. Basically, I want to start the DOS command shell, switch to the MySQL command shell, and execute a command. Here's how I am calling the procedure (also below). Also, how do I handle the "\"'s in the command? ExecuteCommand("mysql --user=root --password=sa ca...

Can anyone recommend an open-source .net component to make barcodes?

We've got a web-based system that will be printing barcodes into PDF files. What I would love is if there was a free/open source .net component that would accept a text string and hand back a graphic of a bar code. Sure, we could just use a bar-code font, but I'd really rather not compute the checksum myself if I don't have to. Ditto ...

What are some tips to make my project compile on a fresh checkout every time?

More times than I'd like to admit I've had people new to a project do a checkout only to find they are missing various resources, dll's, settings. I'd like to get in the proper habit of having my projects compilation be smooth as can be from a fresh checkout. What are some tips or suggestions on how to structure my projects so they do...

Recursive File Search in .net

Hi, I need to search a drive (C:, D: etc) for a partuicular file type (extension like .xml, .csv, .xls). How do I preform a recursive search to loop all directories and inner directories and return the full path of where the file(s) are? or where can I get information on this? VB.NET or C# Thanks Edit ~ I am running into some errors ...