I need to use FtpWebRequest to put a file in a FTP directory. Before the upload, I would first like to know if this file exists.
What method or property should I use to check if this file exists?
...
In this question superwiren asks about the pitfalls for converting a .net 2.0 solution to .net 3.5.
What about .net 1.1 to .net 2.0?
Is 2.0 fully backwards compatible with 1.1?
...
I'm trying to implement a Load / Save function for a winforms applications.
I've got following components :
A Tree View
Couple of List Views
Couple of Textboxes
Couple of objects (which holds a big dictionarylist)
I want to implement a way to save all of this into a file, and resume/load it later on.
What's the best way to do this?...
This only helps kills processes on the local machine. How do I kill processes on remote machines?
...
Some time ago I wrote a piece of code to update multiple rows in a database table. The code was like this
var db = new MyDataContext();
db.Execute("UPDATE Details SET IsActive = 0 WHERE MasterId = 1");
Then the other day when I got the latest version of the file I saw that somebody changed the code to something like this
var details ...
Is there an easy way to move around controls on a form exactly the same way as the tab key? This includes moving around cells on a datagridview etc.
...
I have created an application that writes some data to the root folder of the directory in which it was installed (in Program Files). But under Windows Vista, the program is unable to write to the directory because the UAC restricts administrative privileges.
I need to be able to do the following
Write a file in the folder where the p...
I was wondering what people thought about the decision to support Entity Framework over LINQ-to-SQL? I have an application I'm developing originally in LINQ-to-SQL. I found it the perfect solution for our application.
While attempting to port to Entity Framework I was surprised how rough it was. IMHO, not even close to being ready f...
Is there a tool out there for visualizing dynamic call graphs? I saw a reference to one for Visual Basic 6 but I'd like one for .NET.
If I had to build a visualizer myself should I bother with the .NET profiling API or should I do something with Mono.Cecil? I started writing a CLI runtime with Cecil, but I guess it'd be easier if I just...
Parser Error Message: The entry 'SiteSqlServer' has already been added.
Source Error:
Line 23: providerName="System.Data.SqlClient"/> -->
Line 24: < ! -- Connection String for SQL Server 2000/2005 -->
Line 25: <add name="SiteSqlServer" connectionString="Server=(local);
abase=DotNetNuke2; uid=nukeuser;pwd=dotnetnuke;" providerN...
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and Views that belong together are created by a factory on a separate thread and should get a separate Dispatcher.
Public Function CreatePresenter(Of T As {New, Class})(ByVal p_eCreationOptions As eViewCreationOptions) As T Impl...
Is it possible to override the null-coalescing operator for a class in C#?
Say for example I want to return a default value if an instance is null and return the instance if it's not. The code would look like something like this:
return instance ?? new MyClass("Default");
But what if I would like to use the null-coalescing opera...
I was working with the generic class in vb.net.
And it seems extension method cannot be applied to generic class without specifying the type.
I have this generic class
Public Class MyGeneric(Of T)
'Methods and properties go here
'
'
End Class
This is Ok
<Extension()> _
Public Sub DoSomething(ByVal myGenericDoubleObj As ...
I have implemented tracing based on System.Diagnostics.
I am also using a System.Diagnostics.TextWriterTraceListener, and hooked the whole trace up to a MOSS 2007 Web Application.
The trace for some reason is trying to (a) create the log file, and/or (b) write to the log file using the user that is currently browsing the SharePoint s...
I am using a generic repository interface which allows me to add, find, update and delete objects of different types. I have then implemented two concrete repositories and can switch them around without changing the application. Everything is wonderfully disconnected. But I have hit a snag. The code inside my repository methods just feel...
for code inspiration.
...
Is there any built-in utility or helper to parse HttpContext.Current.User.Identity.Name to get separately domain name if exists and user?
Or is there any other class to do so?
I udnerstand that it's very easy to call String.Split("\") but just intresting
...
Duplicate from : http://stackoverflow.com/questions/16432/c-string-output-format-or-concat
Especially in C# world using String.Format for everything is really common, normally as VB.NET developer unless I have to* I don't String.Format,
I prefer normal string concatenation, such as:
V1 = V2 & "test-x" & V3 & "-;"
to me it's better ...
A recent question came up about using String.Format(). Part of my answer included a suggestion to use StringBuilder.AppendLine(string.Format(...)). Jon Skeet suggested this was a bad example and proposed using a combination of AppendLine and AppendFormat.
It occurred to me I've never really settled myself into a "preferred" approach fo...
Hi all,
I am using NetworkInterface.GetAllNetworkInterfaces() to get all the interfaces on a PC. However, this appears to only return "active" interfaces. How can I find "inactive" network interfaces, such as unconnected VPNs, disabled NICs, etc. in .NET.
I would like to find them by their name in "Control Panel" -> "Network Connectio...