.net

Directory.CreateDirectory Latency Issue?

I'm trying to create a remote directory, and then write a file to it. Every great once in a while, the application fails with a System.IO.DirectoryNotFoundException while trying to write the file. When I write the file, I'm using the returned DirectoryInfo object to help create the file path, so the application seems to think that the d...

What is the best way to select a text portion to cut based on keywords?

When you search something in Stackoverflow it cuts the portion of the question description that best matches your criteria and after that it marks the criteria words. I wonder the best way to do this manually in C#, meaning without the help of a full-text search engine. The main problem is how to select the best text portion in a fast ...

COM DLL - using Mono instead of MS .NET Framework

I have a DLL written in C# which is acessed by a native EXE (written in Delphi) via COM. Now I was asked to make it work with Mono (on Windows, not Linux) instead of Microsoft .NET Framework. Is it possible to be done? If it is, how can I do it? ...

.NET Configuration / ConfigurationManager exePath

When creating a Configuration object, it asks for a path to a config file... I keep getting an exception thrown for an invalid file path... What's a valid path? I've tried "config.config" and ".\config.config", but I can't think of anything else. ...

How do I allow an implementation to call a Mock (Moq) method with its own arguments?

When testing a class that uses a Moq dependency, I'd like the class to supply the arguments to a Moq method, rather than creating the arguments myself in the test case. I have an interface, that has one method, which takes one argument. public interface IMessageForwardProxy { IMessage Send(IMessage request); } I have a class that...

Connect to SVN from Windows Mobile

I have been trying to find a framework for windows mobile and .Net Compact to connect to an SVN Repository but i havnt been able to find 1. Is there an SVN Framework out there for .NET Compact? If there isnt a framework, whats the best way to attempt to connect to an SVN Repository? At the moment im looking to get the revision history....

delay in receiving email sent from c#

here is my code for(int i = 0; i < number ; i++) { MailAddress to = new MailAddress(iMail.to); MailAddress from = new MailAddress(iMail.from, iMail.displayName); string body = iMail.body; string subject = iMail.sub; oMail = new MailMessage(from, to); oMail.Subject = subject; oMail.Body = body; oMail.IsBodyHtml = true; ...

Why does .Net use a rounding algorithm in String.Format that is inconsistent with the default Math.Round() algorithm?

I've noticed the following inconsistency in C#/.NET. I was wondering why it is so. Console.WriteLine("{0,-4:#.0} | {1,-4:#.0}", 1.04, Math.Round(1.04, 1)); Console.WriteLine("{0,-4:#.0} | {1,-4:#.0}", 1.05, Math.Round(1.05, 1)); Console.WriteLine("{0,-4:#.0} | {1,-4:#.0}", 1.06, Math.Round(1.06, 1)); Console.WriteLine("{0,-4:#.0} | {1,...

RIA services WCF timeout

Hi All, I have an application which is written in silverlight 3.0. It uses RIA services to communicate between the client and server. My question doesn't seem to be answered very well on the web. The client communicates to the server using RIA services, which uses WCF behind the scenes. If the communication takes more than 60 seconds i...

need to print labels from a ecommerce website

Im a wiz with php but i have a challenging client- who wants sandwich labels printed automatically as they are ordered from their website. what is the best solution for this- the e-commerce website is a php/mysql website i can do a call to some sort of service running but i have no idea how to print the info? what hardware is required.....

Question about ASP.NET MVC and DropDown lists

Hi folks, I'm about to start a new ASP.NET MVC application. In it we have a number of drop downs lists/boxes. I have no problem rending them to the ui etc. My two questions are:- Is it possible to bind the selected value of a drop down list to an enumeration? Does anyone else actually do this (if this is possible) Are there any goo...

Making a call to a page that returns JSON using ASP.net AJAX

I have a Page that expects a POST Request and returns some JSON. Essentially it's an .ashx Page, but that doesn't really matter. When using jQuery, I would use jQuery.Post with "json" as dataType to simply make the POST request and get an object back. However, for the current project I mainly use ASP.net AJAX and I don't want to add jQu...

What is the difference between Microsoft.Web.Management and System.DirectoryServices in .Net 3.5?

Hi there, I want to control, configure and manipulate IIS 6.0 and later versions via ASP.Net web application using WMI and .Net. Can i use a mix of Microsoft.Web.Management and System.DirectoryServices? Is there a difference between the two? Will System.DirectoryServices be supported for later versions of IIS. i.e IIS 7.0+ ? Where is...

How to design a persistent object where a generic type would be greatly helpful.

I'm creating an object that will be used to store 'known quantities' or facts. Ideally, it'd look something like: public class KnownQuantity<T> { public T Quantity { get; set; } public KnownQuantity(T quantity) { this.Quantity = quantity; } } However, this class is to become a persistent object. Currently I'm...

Which is better for IIS administration in ASP.Net : WMI or ADSI or Managed API? and what's the difference?

Hi there, I am working on Configuring and manipulating and controlling IIS 6.0 and later versions using ASP.Net based web application. I am considering WMI, ADSI, Managed API as my options. I have a target Windows System WIN2k3 or later versions. The choice of language is C# and the application has to be built using ASP.Net. This art...

how to perform Parallel Development, Side by Side execution, Backward compatibility in SqlServer 2008 integration.

i want to know about Multi monitor support, Multi targeting, Parallel Development, Side by Side execution, Backward compatibility and SqlServer 2008 integration. all in one.. ...

How to auto increment the date value in vb.net?

How to auto increment the date value in vb.net? Name - asdf From Date - 23/02/2009 To Date - 12/03/2009 From Date and To Date is Datepicker column When i click the add Button, from Date should display in the textbox, then again i click the add button the next date should display in the textbox. The date should increment upto To Date...

Detect someone hooking onto a window handle

Can you detect if someone is trying to hook into a window handle of your application (or a part thereof) in .NET? ...

how to embed exe files of 2 different env. in one using .net?

is there any way to embed two different exe's build in different environment..can be made to embed in one.. like i want to embed c# running program in the asp program?? ...

To Understand .Net Configuration files

Would like to explore the .Net Configuration (web.config & machine.config..), please help me by providing the URLs which can help me on this. Thanks! Karthikeyan ...