.net

Can you move a file/folder across a network share in .NET?

Trying to do this: Dim originalPath As String = "\\comp1\c$\target" Dim destinationPath As String = "\\comp2\c$\target" If Directory.Exists(path) Then Directory.Move(originalPath, destinationPath) End If But it fails. Is there another way I can achieve the same effect? ...

Could this WPF code benefit from Parallel.For and how ?

Hi, I'm wondering if there is a way to convert this so it would be more performant by using a Parallel.For for example. public FrameworkElement FindIntersectingElement(Rect rectangle, UIElement activeElement) { foreach (var child in this.Children) { if (child != activeElement) { if (GetBounds(chi...

PHP nuSoap issue when connecting to a .NET server: "Object reference not set to an instance of an object."

I am currently working on a SOAP project using PHP. The script is connecting to a remote .NET service server. I get a nice response using the HelloWorld action the provide, but when the script goes to get any other data using other actions, I get "Object reference not set to an instance of an object." in a diffgram sub array of ...

Can .NET 4.0 code interoperate with .NET 2.0 code?

Are there compatibility barriers with a .NET 4.0 assembly calling code in a .NET 2.0 assembly? And vice versa? More specifically, I'm investigating an upgrade to Visual Studio 2010 when using a third party application based on .NET 2.0. The application is extensible by hooks that reference my custom code. And vice versa, my code will...

How can I translate my programmatic WCF configuration into app.config

Hi, I have an self hosted WCF server with hard coded configurations. the server worked fine until I tried to implement some new configurations functionality (changed ports, added ssl) the new config setting did not work (urrr.... ) and I find it hard to locate where are the problems in my code. instead of digging inside the code tha...

Creating Options Menu with overlapping panels

I'm trying to create an options menu in a C# forms project, and I'm curious if there's a less ugly way to do this. I have a ListBox that has the different categories of options, and when you select a category, the options for that category appear in a panel on the right. Basically, something identical to the options menu in Visual Studio...

Windows Service Fails on Launch

I'm trying to write a windows service. It installs fine, but fails when I run it with the following exception. I've searched for the string "MyNewProgramService", but I can't find any conversions that would throw this error. I've also added try/catch blocks to a bunch of code with custom exception handling without finding where this ex...

How to work properly with data in .NET?

I'm using a datagridview in C# WinForms, with data from a Sybase database, and characters are not showing correctly. This is what I see: Do you know how can I fix this? ...

Are there any Opensource, free XF.Network analogs (product for creating fast servers with .Net)

Opensource, free XF.Network analogs (product for creating High Performance TCP/IP Server using C#.NET) ...

Set Page Output Cache VaryByCustom value programmatically

I want to use an Enum value for the types of VaryByCustom parameters I will support, is it possible to do this? I tried setting it in the page itself <%@ OutputCache Duration="600" VaryByParam="none" VaryByCustom='<%=VaryByCustomType.IsAuthenticated.ToString(); %>' %> But this returned the entire literal string "<%=VaryB...

How to convert "0" and "1" to false and true

I have a method which is connecting to a database via Odbc. The stored procedure which I'm calling has a return value which from the database side is a 'Char'. Right now I'm grabbing that return value as a string and using it in a simple if statement. I really don't like the idea of comparing a string like this when only two values can ...

Hardware for .NET Micro Framework

I would like start with .NET Micro Framework as my hobby project. What hardware devices would you recommend for that? Is there something like list of all hardware with support .NET Micro Framework? ...

log4net: Creating a logger dynamically, should I worry about anything?

Hi, I need to create loggers dynamically, so with a post from here and the help of reflector I have managed to create loggers dynamically, but I'd like to know if I should worry about something else ... I don't know wich implications can have do it. public static ILog GetDyamicLogger(Guid applicationId) { Hierarchy hier...

How do I confirm a given page was displayed after calling ISelenium.open()?

I'm very new to Selenium RC. I'm using .NET (though I don't think it is relevant), I have opened a page, but I want to confirm that the page was actually opened. I have a few ideas like using .Select() or using one of the .get*() methods, but I want to do what is considered the best practice by others in the Selenium community. ...

XmlSerializer Mixed Content Deserialization

How do I setup my class to deserialize the following mixed content xml? <employee> <name>John Doe</name> <remark>He is a <match>tall</match> and handsome man</remark> </employee> ...

LINQtoSQL Custom Constructor off Partial Class?

Hi all, I read this question here: http://stackoverflow.com/questions/82409/is-there-a-way-to-override-the-empty-constructor-in-a-class-generated-by-linqtosq Typically my constructor would look like: public User(String username, String password, String email, DateTime birthday, Char gender) { this.Id = Guid.NewGuid(); ...

Can I call a UDF at Frontend

I have a UDF in sql server. I want to call this function at frontend (C# Code). Is it possible to do it. ...

Sending Email over VPN SmtpException net_io_connectionclosed

I am sending an email from a WPF application. When sending as a domain user on the network, the emails sends as expected. However, when I attempt to send email over a VPN connection, I get the following exception: Exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the t...

Serialization problem: Different namespaces (.NET)

We released a program that serializes a very complex object using the .NET soap formatter. Soap didn't handle new versions of the classes involved very well so we're switching to the binary formatter. To handle old object versions, I wrote a converter that deserializes the object in soap, and re-serializes it in binary. The converter ...

Visual Studio 2010 (maintaining backwards compatibility)

I know in Visual Studio 2008 you can target a specific framework with your projects, but from what I have been told if you open a project originally created in Visual Studio 2003 or 2005 in Visual Studio 2008, it requires you to upgrade the project to a 2008 project to work on it. Does Visual Studio 2010 have this same type of restrictio...