.net

how to set CPU affinity of a program?

Hello everyone, I have a program written in C#, I am using VSTS 2008 + .Net 3.5 + Windows Vista Enterprise x86 to develop a Windows Forms application. My current computer is dual-core CPU, I want to set CPU affinity of my program to run on a specific CPU and free another CPU to do some other job. Any ideas how to do this? Either throug...

How do I add a attribute to a XmlArray element (XML Serialization)?

How do I add a attribute to a XmlArray element ( not to XmlArrayItem ) while serializing the object? Thanks and regards 123Developer ...

With WSS, is it possible to customize the Admin?

I'm thinking of implementing WSS, but I want complete control over the Admin interface, as far as look-and-feel and navigation. Is this possible? ...

WiX: How to register application to start when Windows launches?

I'm exploring distribution of .NET desktop applications with MSI generated by WiX. So far it works great. But I've got a few questions, googling can't help out with. What's the advised way of registering application to start when windows launches (in WiX)? What WixUI could I use and how? Notes: The application is not a Windows Ser...

Managing internal dependencies

I'm having a bit of trouble figuring out how to manage the internal dependencies that I have in a SDK I'm developing, for some reason everything I try just seems to be hard to work with. Say I have these classes: class Table { Table(string name,IQueryProvider provider, IComObject comobject) {} } class TableFactory { Table BuildT...

StateServer to save session

Hi, We are going to update our asp.net application to save session in state server. Any attention required to avoid problems after the update? It is going to run in IIS 6 and IIS 7. Thanks, P.Gopalakrishnan ...

deep zoom is not displayed

Hello everyone, I am using VSTS 2008 + C# + .Net 3.5 + Windows Vista Enterprise x86. I have used Silverlight Deep Zoom composer tool to export my composed images into Siverlight type. Everything is previewed fine after export successful message (I select browse from browser). But when I click the Test.html in the exported project to sh...

Siverlight setup issue

Hello everyone, If I just deploy Siverlight application (eithre ASP.Net page or Html page uses XAP files) on Server, no need to develop. On Server side, do I need to install anything? I have two scenarios, Using Windows Server 2003; Using Windows Server 2008. thanks in advance, George ...

Finding Available Time Slot C#

We are building a slot booking system but the slots are dynamic that get updated live from the handhelds. I have got to the stage where we have the booking screen i know i have an avalible day and time slot between e.g. 8am and 10am. When i book the slot i need to put 2 records in a table 1 for job time and 1 for travel time. e.g. Slot...

Return typed DataTable from Linq Query

Hi. I have a (disconnected) typed Dataset in an XML, which I query in LINQ: var productlist = from prds in dsProducts.Products.AsEnumerable() where (prds.Field<string>("productid").Contains(searchpattern) || prds.Field<string>("productname").Contains(searchpattern)) select prds; This list is fine, but if I try to say: return ...

Prolog Compiler for .Net

Can anyone recommend a Prolog compiler for .Net. The ones that I have been able to find searching the net, do not appear to have been updated for several years. Thanks Shiraz ...

Is there a more performant alternative to ImageList.Images.Add?

I have a winforms ImageList which contains 200 256x256 images. When I add the images, 1 by one, half of the programs time spent on the Add method according to ANTS .NET profiler. So the program takes 10 secs to launch and 5 is spent there. That is very slow in my opinion. I implemented the same thing using ImageList.Images.AddRange. T...

Image.FromFile is very SLOW. Any alternatives, optimizations?

I have a winforms image list which contains say like 200 images 256x256. I use the method Images.FromFile to load the images and then add them to the image list. According to ANTS .NET profiler, half of the program's time is spent in Images.FromFile. Is there a better way to load an image to add to an image list? Another thing that mi...

Finding the position of the caret in a TextBox

I need to know the position of the caret in a TextBox so I can pop up a context menu near it. How do I find its placement (not character index)? ...

How to get Max String Length in every Column of a Datatable

I have a DataTable object. Every column is of type string. Using LINQ, how can I get the maximum string length for every column? ...

What is the easiest way for two separate C# .Net apps to talk to each other on the same computer.

I would like my two applications to be able to send strings to each other and depending on the string "do something". This is for a pre-proof-of-concept-mockup type of thing so no security precautions needed and as inefficient as you want. So how do I do this with a minimum of work on my part. (You my dear fellow so user can work as h...

Help me optimize this snippet.

Is it possible to speed up this snippet? firstSample and lastSample is the part of the array I'm interested in this iteration. It's when this interval reaches > 3000 that I get a noticeable slowdown. The _average array can contain 6-60 million int values. minY and maxY is the result I use after this calculation is completed. int min...

.NET to Java Tutorials

I have been asked to create a simple database web app using Java. I'm a C# .net programmer and I haven't really created any Java web apps before. Do you guys know of any good books/online tutorials that can help me catch up on how Java web apps work? I got very little time to get up to speed, so any thorough examples will help a lot. ...

How to set a base class internal field

Hi, Im extending a class (DirectoryServices.AccountManagement.Principal) and I need to assign a value to a field in the base class but its marked internal. Can I use reflection to set the value? How would that be done? I found this: base.GetType().GetProperty("unpersisted").SetValue(??, false); But im not quite sure how to give it t...

How to know when the window zorder changes

Looking for a way to be notified when any windows ZOrder changes? Zorder refers to the layering of the windows. a zorder of 0 is at the bottom. I don't know any other way to ask this question. This would be for Windows XP or newer, using .NET, c# OR vb.net. ...