.net

What is the correct way to set StringBuilder.Capacity when using P/Invoke?

Should StringBuilder.Capacity be set to the maximum number of .NET characters, without regards to null termination, or must it be set one higher to reserve space for a null terminator when using P/Invoke. The natural reaction is that it should be set one higher, but it seems like P/Invoke is supposed to automatically compensate. In fact...

Is there an analog to "locate.replace()" in Silverlight 4 Navigation?

If a user navigates to a page that displays an "add item" view (#/items/add), I want to basically skip that url when they click "back" after they save the item. How can I do this? Here is the behavior I'm after in more detail... if the user has navigated to and is currently on this silverlight url: #/items/list when they click the "a...

Can XmlReader parse out distinct entity references?

My XmlReader instance created by factory method XmlReader.Create(..) is including entity references along with surrounding text into one complete blurb of type XmlNodeType.Text (It's actually unescaping the entities into the text). For example if the XML source contains <div>this &amp; that</div> XmlReader will parse out readerInstanc...

bluetooth connection in vc#.net

I want to create an Bluetooth chat room for pc i will use visual studio 2005 as the front end i just want to know how do i connect one system to another system with each other and send data or message using an Bluetooth in vc#.net software like intranet chatting use's LAN as connection medium traditional way to connect to one system ...

.NET events, threads, and messages

I understand that an event handler executes on whatever thread that invoked the event. I further understand the need to update form controls only from the thread that created the controls. I am assuming that the UI thread is the one that created the form for the purpose of this question. If the event is the result of a posted message,...

Using structuremap how do I resolve a type when I only have a string from the type name

Hi I have a requirement to use a plug in model where I need to allow types of ITask to be created by structuremap but where I only have a string of the type name at runtime. These types need to use Ctor injection to be composed, so I can't build up an existing type. Also, I don't want to get all types and then query the type name as th...

Library design practices that work while doing development in Microsoft .net technologies

I was looking for a book or msdn article for developing a framework/library which extends the .net framework like here. Where can I find good design guidelines? ...

Create automation macro support within an application

Hi All, I need to get an automation macro like thing within our desktop application. The desktop app will probably be in VB.NET or C#.net. The reason is to enable the user to record and replay certain tasks that they'd like to automate. Something like macros within office apps and visual studio. The first thing that comes to my mind is ...

Asp.net add content automatically

Hi, For my site I want to have a page which I will call programatically to add content. The parameters that I will need are some strings and the content of a file. I will invoke that with WebRequest object form .net. How can I send the string parameters and the content of a file in a post request and read them in the aspx page? Is ...

.NET or Java ? Which one land me a job ?

Hey, I am currently in the final semester of my 4 year Computer Science Program . In a few months time, I will be looking for a Software Engineering job. I am looking to become a specialist in some language/technology and I cannot decide between .NET and Java.. Which one is more likely to land me a good job? Which one will be used in ...

Why does WebClient.DownloadStringTaskAsync() block ? - new async API/syntax/CTP

For some reason there is a pause after the program below starts. I believe that WebClient().DownloadStringTaskAsync() is the cause. class Program { static void Main(string[] args) { AsyncReturnTask(); for (int i = 0; i < 15; i++) { Console.WriteLine(i); Thread.Sleep(100); ...

.NET Windows Service: Implementation of tasks - design flaw?

Hi, I am having one of those moments where I am struggling to do something neatly which automatically makes me think maybe I have got this wrong. I have a ServiceTaskManager (yes, I know people will not like the name) class: Public Class ServiceTaskManager Inherits MyAbstractClass Implements IWork, IServiceWork Public Sub...

Session loss analysis

Hi, our web application frequently losses it's session state (user is being logged out very often). I predict that the reason of such behavior are some exceptions thrown and unhandled in side threads of application or whole application restart. I'm pretty sure that it's not caused by recycle worker, because it happens in irregular peri...

When creating database for enterprise applications, is it any useful to keep create date

I have just started with professional programming and my manager tends to dictate that i keep create, modified and delete date in all database tables that we use. I want to know does it makes sense to keep these fields for enterprise application. The reason I am asking it that because all examples, tutorials i have ever read on net, book...

Load assembly doesn't worked correctly

I try to load a assembly into my source code in C#. So i first compile the source file: private bool testAssemblies(String sourceName) { FileInfo sourceFile = new FileInfo(sourceName); CodeDomProvider provider = null; bool compileOk = false; // Select the code provider based on t...

silverlight treeview

Using WCF i get data from server. Data contains Folders and these folders contain queries. I need to set folder icon(expanded collapsed) on the folder node and another icon on query. TreeView is bound to this collection using HierarchicalDataTemplate. I tryed to do it with converter but failed. I also want it to be MVVM compliant. <sdk:...

How do I draw Text at a 2D location using Tao OpenGL Framework

Hi, Can anyone tell me how I can draw text at a 2d location using the tao framework? Thanks ...

What's the role of AssemblyFileVersionAttribute?

Hello, I don't know what is the concrete purpose of the AssemblyFileVersion attribute. I know that AssemblyVersion is part of the strong name, which is the 4-pla (assembly name, assembly version, culture, public key token), but I have no idea on how correctly use the Assembly*File*Version. I currently use the BuildVersionIncrement plug...

How to supress C# warning CS0675 : Bitwise-or operator used on a sign-extended operand

Hi, I can't seem to get rid of this warning for the following line of code: d.word[wrdIndex++] = d.GetWord(english) | (ulong)i; the warning applies to the code after the assignment operator. the method GetWord returns a ulong. I've tried the following to no avail: d.word[wrdIndex++] = (d.GetWord(english) | (ulong)i); d.word[wrdIndex+...

Hadoop Streaming in .NET

Hello All, I am running hadoop in Pseudo-Distributed mode and using hadoop streaming to do my map-reduce operations. But the problem is I keep getting Streaming Job Failed error message. Following is the log: stderr logs java.io.IOException: Cannot run program "input/StdInOut.exe": CreateProcess error=2, The system cannot find the fil...