.net

Credentials for Send Emails to MS Exchange 2007

I am writing a very simple application to send emails via MS Exchange 2007. No authentication is required to start the application. However, my application will be installed on the Hub Transport Server, instead of the Mailbox Server. Hence, I am not sure if I need to provide any credentials in my codes to send the emails. Or can I simply...

Distributed file system for .NET

Lately I've been reading up on HDFS (Hadoop) and GFS (Google) and find myself wondering if there are any similar native implementations for windows and/or .NET. A lot of the applications I develop include features to support user generated content, and currently, that means relying on some type of storage service such as Mosso or S3, or ...

i want to capture all tags not having a specific tag

i want to capture all tags named 'STRONG' i can use <STRONG.*?</STRONG> this is working just fine but i dont want to capture these tags if the 'SPAN' tags come in these tags i want something like <STRONG.*(^(SPAN)).*?</STRONG> this is the sample text <STRONG> For technical <SPAN id=PageBreak>101</SPAN> please</STRONG> <SPAN id=PageBreak...

When deleting and creating performance counters in a service it can hang the service

In a app i have written we delete and recreate the performance counters as the app spins up. When running this from a console the application deletes and recreates the counters and the counter category fine. When we run from a service, the app deletes the counter category as expected but when creating the new category it hangs until th...

What case to use when comparing strings in Microsoft programming languages?

Note: This is a question I’m asking more out of historical interest, as I realise that modern languages have built-in regular expressions and case insensitive string compare methods. When comparing two strings of an unknown case, I can remember reading that Microsoft based conversion methods where optimized for uppercase rather than low...

Restyling just part of a wpf control. Is it possible?

I want to restyle just part of a WPF control. (Specifically, I want to make the scroll buttons on a ScrollBar bigger) Now I can do this no problem. I extracted the default style. Made the required tweaks and included the modified style in my application. The problem is that I have to include the entire control template in the replacem...

Why is an insert of 1M records slower without a transaction than inside a transaction?

I am doing some performance tests using .Net 3.5 against SQL Server. I am doing an insert of 1 million records. When I wrap this inside a transaction (either serializable, RepeatabelRead or ReadUncommited) it runs in under 80 seconds on my system. When I remove the transaction it runs in roughly 300 seconds. I would expect that using no ...

What's the most efficient way to store objects in a SQLCe Database?

I need to increase the performance of a compact framework application which uses a SQLCe database to persist cached objects between sessions of the application. Currently, objects are serialized into XML and stored in a SQLCe database, but having run a profiling tool it seems that there is quite an overhead in doing this. I was thinking ...

Does List<T> guarantee insertion order?

Say I have 3 strings in a List (e.g. "1","2","3"). Then i want to reorder them to place "2" in position 1 (e.g. "2","1","3"). I am using this code (setting indexToMoveTo to 1): listInstance.Remove(itemToMove); listInstance.Insert(indexToMoveTo, itemToMove); This seems to work BUT I am occasionally getting strange results; sometimes ...

DataSet: Enumerator and FindById do not return equal DataRow

Hi folks Today's problem in my code is kind of strange, and I could not reproduce it yet. I'm working with a typed dataset (created with the designer) and I'm looping over all rows in a datatable. Sometimes (!), when finding via primary key, the returned row is not equal to the one from the enumerator. This is some code I wrote to repr...

What is a first class .NET language?

So I was listening to Hanselminutes Podcast 158 where Joel Spolsky mentions that Wasabi is a first class .NET language. What does that mean? ...

How to buffer output from a .net BackgroundWorker ?

I have a stream of data coming in from an external source which I currently collect in a BackgroundWorker. Each time it gets another chunk of data, it presents that data to a GUI using a ReportProgress() call. I get the impression that the ProgressChanged function is just a synchronisation mechanism though so when my worker thread calls...

Throttling MSMQ messages / prioritising messages

I'm not sure how best to describe this, or the best title, so bear with me! I'm using MSMQ to queue up a large number of commands that will fire off HTTP requests to various websites and APIs. In order to avoid hammering these services (and to stay within certain pre-defined request limits) I need to ensure tasks hitting the same domain...

Where is the .NET 2.0 GAC under Windows Server 2003?

I'm looking for the GAC under Windows Server 2003 and I can only find the GAC for .Net 1.1 Where can I find this folder? ...

SQL Server Create Function (CLR) - nested types

Is it possible to create a CLR function mapped to a method of the nested type? CREATE FUNCTION [dbo].[MyClrFunc] (@s NTEXT) RETURNS NTEXT AS EXTERNAL NAME [MyAsm].[MyNamespace.MyClass+MyInnerClass].MyFunc; the SQL Server keep feeding me with the same error: MyNamespace.MyClass+MyInnerClass ...

C# Check Remote Server

Can anyone advise what the best way to check (using .NET 3.5) if a remote server is available? I was thinking of using the following code but would like to know if a better way exists if the community has another option. TcpClient client = new TcpClient("MyServer", 80); if (!client.Connected) { throw new Exception("Unable to conne...

How do I get the Current User identity for a VPN user in a Windows forms app?

We're currently developing a Windows Smartclient that needs to authenticate users using their AD group membership. We now have a requirement for some users to connect over VPN. Is there any way I can get the AD account identity and groups from the VPN login? WindowsIdentity.GetCurrent() returns the local user account rather than their ...

.NET string IndexOf unexpected result

A string variable str contains the following somewhere inside it: se\"> I'm trying to find the beginning of it using: str.IndexOf("se\\\">") which returns -1 Why isn't it finding the substring? Note: due to editing the snippet showed 5x \ for a while, the original had 3 in a row. ...

How do I return multiple generic Lists in one Web Call ?

Ok, I poked around before posting and can't seem to find anything... so here we go. I decided that returning datasets, working with datasets and datatables in a front end app is a rather bad idea. So with the magic of generics I am returning a generic list via Webservice call ( not WCF just plain ol' asmx ) . That works dandy as long as...

How to add external file to application files ( clickonce / .NET)

I'm using 'Publish' option in vs2008 and I'm pretty happy how it works. Now I'd like to add 2 external *.exe files to installed package I've noticed button 'Application Files...' at publish tab but it seems doesn't allow adding new files manualy. I've played with this and found the way how to archive that: 1. add EXE files to project a...