.net

How do I create four custom folders on the root (C:\) of the target machine in a VS 2005 setup project?

I need to create four custom folders that are on the root of the target machine (C:\Folder1). I've created folders and placed files in .NET setup projects in the past, but I'm usually using pre-configured locations such as 'application folder' 'common files folder', 'program files folder', etc. I can create a custom folder, but how can...

check files in one directory and store their name in order of the creation time

I want to keep a list of existing log files from the log directory. whenever this list reached the max limitation, say 20 files, I will delete the oldest log file. Each time when application is launched, it will check the log directory and keep all log file names in a list. but this list should be sorted with the creation time. what's...

Events wont fire across modules (prism, MVVM, silverlight c#)

Righty oh now I believe ive set this application up right but correct me if im wrong, for simple sake i have in my bootstrapper 3 modules loaded, one is a navigation module, and two others the views. Independently in code if i load the modules and in the initialize method add them to a region that all works fine, however ofcourse id lik...

constant-time set operations

Are there constant-time algorithms for binary set intersection and union? I imagine using bitmaps with pointers to elements in the memory and using OR for union and AND for intersection. Does anyone now of a solution? ...

How do I set the width of a textbox when editing a row in a GridView?

I've got a GridView that can be edited. My problem is that when I click Edit, the textbox is too small (the File Name column). It isn't large enough to display its contents, and it isn't as wide as the rest of the column. How can I make that textbox wider? Here's the ASP code: <asp:GridView ID="FileGridView" runat="server" AllowPagi...

Enable / Disable Aero in C#/VB.NET or C++ Win32

How to disable aero effects in C# .NET or C++ Win32 ??? This is my test code in C/C++, but only works if my app is runnig #include <dwmapi.h> int main() { DwmEnableComposition(DWM_EC_DISABLECOMPOSITION); while(true); //... return 0; } //LINK dwmapi.lib Thanks Edit: i figured it out #include <Windows.h> #include ...

Background image won't display at its original size

With the following code, I can't get the background image to display at its original size (it's always a fair bit larger). I tried changing the Stretch property, but "None" seems to be the most appropriate value. <Canvas Width="500" Height="500"> <Canvas.Background> <ImageBrush ImageSource="{Binding ElementName=...

How to get image from silverlight to non-silverlight ?

Hi, I need a very weird thing I admit. I hope you'll be able to help me. My current situation (all in one solution VS2010): I have the Silverlight assembly with user-control (basically a drawing of kind) I have a WCF service to provide the images (hosted in the website project) I somehow need to: when someone requests the RESTful...

Java .NET vs PHP Rails

What are the benefits of using a compiled solution like .NET of Java over an interpreted solution like PHP or Ruby for building a Web Application/Web Site. It seems like Java or .NET apps would require a lot more overhead compared to a PHP/Rails solution. ...

Missing Row in Datatable Modified property

Updating the first record listed in my DataGridView that is bound to my DataTable. When I run Save process I run through this line of code to get all records that have been modified: DataTable modifiedRows = unitDataDT.GetChanges(DataRowState.Modified); If I have changed the first record in my DataGridView my modifiedRows DataTable i...

Mouse event not reaching UIElement.

Hello smart people. I'm just getting into C# and some unfamiliar piece of code so apologies if my question is not well asked. The problem in short - I have a six by eight grid of System.Windows.Controls.Canvas objects. The top left canvas does not receive mouse events while all the others do (I tried OnMouseMove and OnMouseClick events...

loading applications in .net

how to laod an application in .net and how to get the memory usage and cpu utilization of the loaded application. ...

Dynamic webservice url in app.config not working

When I deploy my c# console application (with the .config.exe), everything in the console app (like database connection string) is seemingly working fine. However, when it makes a call to a webservice, it's using the url we use in development and not the production url in the app.config .. The service is set to dynamic.. Any ideas? ...

Finding the shape created by two other intersecting shapes

I have two overlapping shapes in my C# app, defined by Point arrays. I need to find the points that define the shape where these two overlap. In this image, I know the red and green points, but I need the yellow points. Here is some dummy code that might help: Point[] GetIntersection(Point[] red, Point[] green) { Point[] yellow =...

Is there an API to the Visual Studio class diagram graphical components?

official or unofficial. I've been digging around the VS assemblies with Reflector, with no success so far. ...

How can I Remove registry entries on UnInstall (Install was done with Windows Installer)

I have a small WPF application that writes some basic information to the registry during program execution. The application is packaged with Windows Installer. How can I tell the Windows Installer to uninstall registry entries that were created during program execution when the program is uninstalled through the control panel? (Also no...

How to mock a method that returns an int with MOQ

I have a class that does some retrieving of contents, and it has a method that requires some inputs (filters) before retrieving it. One of the "input" calls another method, which basically returning an int, how do I mock it using MOQ? Here's an example: namespace MyNamespace { public class ConfigMetaDataColumns : MyModel { ...

How do I prevent Lotus Notes users from forwarding or copying a message sent via System.Net.Mail?

I want to send email using SMTP client uiing microsft.net with C# as programming language. But for the emails sent through SMTP client, can we add security features like "no forwarding" or "no copying" etc. I dont want recipients of the email to forward or copy the content of the email. ...

Receive Service Broker from a CLR stored procedure.

Hi guys! I'm trying to move this T-SQL stored procedure to a CLR procedure, but there's a Service Broker specific command that I don't know how to implement: DECLARE @msgBody XML DECLARE @dlgId uniqueidentifier ;RECEIVE top(1) @msgBody = message_body, @dlgId = conversation_handle FROM dbo.Targ...

Keeping ConnectionStrings in a global class

Instead of calling ConfigurationManager.ConnectionStrings("db1").ToString() and ConfigurationManager.ConnectionStrings("db2").ToString() all over the place in my DAL, would it be fine to create a static global class (ConnStrings) with static read-only properties (db1 and db2) and replace the calls with ConnStrings.db1 and ConnStrings.db2...