.net

What is the equivalence of End (vb6) when we wanna to end using c# for windows applications?

Hi What is the equivalence of End (vb6) when we wanna to end an application using c#? ...

tab control webpart?

Hello everyone, I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5 + ASP.Net. And I want to develop a WebPart, like a tab based control, like task manager, items (e.g. processes, users, etc.) are managed by tab on the top for different categories, and in each...

.NET Console app command line parsing of file arguments

I am doing a command line app that needs to read some files and do some processing. There can be many file arguments on the command line, and each of these can be in one of the following formats: Relative path, with or without wildcards. Complete path, with or without wildcards. Network shares should be supported. What is the easi...

Is there a way to configure IIS 5.1 remotely without DirectoryServices?

I need to view information about virtual directories in IIS on an XP machine (ie, IIS 5.1) from a remote computer. I have used the DirectoryServices namespace in the past successfully, but I am unable to now because (I believe) it uses particular parts of ADSI that are only installed with IIS - so it cannot be used on a client machine ...

Using SqlCacheDependency to get real time updates? - ASP.NET

I would like to display real time updates on a web page (based on a status field in a database table that is altered by an external process). Based on my research, there are several ways of doing this. Long Polling (Comet) - This seems to be complex to implement Regular Polling - I can have an AJAX method trigger a database hit every 5...

Linq to SQL or the Entity Framework for Enterprise ASP.NET MVC application architecture?

I am still trying to figure out the right architecture for a complex ASP.NET MVC web application. I looked in a lot of example code and everywhere it's done differently. I would really appreciate your thoughts on this. Another Question: Would you use Linq to SQL or the Entity Framework? Thanks, -Ben ...

assemblyBinding in .NET app works with old version if new version is not available?

Hello guys, I've specified an assembly binding for a newer version of an assembly used in my app, and works great. However, on one of my client machines, the new version of that assembly is missing, but instead the old one is present. When I try to run the app, it says it cannot find the new version, which is normal, I guess. The quest...

SystemTimeToTzSpecificLocalTime - how to get utc offset and time zone

I have a need to convert a utc system time to local time and find the corresponding utc offset. I wouldn't mind getting the time zone also. As far as I can tell, SystemTimeToTzSpecificLocalTime returns no information on these. Anyone have a good way of determining the UTC offset and time zone? ...

Passing IEnumerable across appdomain boundaries

Is it generally a bad idea to pass an IEnumerable across appdomain boundaries? I ask because with my current understanding of IEnumerable implementations, the enumerator isn't going to be used until the collection is, well, enumerated. When you are crossing appdomain boundaries, particularly involving multiple processes, would this not...

For Eaching into a Class's Members

Is there a way to enumerate or simply for each into a class's member variables in .net ? I have a static class, which i want to use for holding the application settings, so while saving the settings I basically want to copy the values of the Static Class to a Instance of a class containg the same set of (non-static) variables . SO i tho...

Unhandled Exception in XAML - How to solve ?

Hi, Please help me to understand the problem and solve this: Thanks ! ...

How to detect the usage rights (DRM) of a file

Suppose you have a .wma / .wmv file and you want to detect: is it DRM protected ? (then hopefully) details of the DRM protection (like when does the license expire etc.)? Is there a C# / C++ api for it? It seems that Windows Media Player can do it - if you click properties on that file... but Explorer does not show this info. Note:...

Configure static properties with spring.NET

What are best practices to configure following class with spring.NET? using System.Collections.Generic; using Edu3.DTOModel; namespace Edu3.Data.SubsonicProvider.RepositoryFramework { public static class RepositoryFactory { private static readonly Dictionary<string, object> Repositories = new Dictionary<str...

c# cannot access a disposed object

I am making an server/client application. I set server socket to listening, and set BeginAccept() method. And when I closed server socket (Socket.Close()) to turn off server, an exception thrown from BeginAccept() method's async callback method. I inspected exception, and I found the exception saying me this: Message "Cannot access a d...

Converting Words(string) to number in .net with culture

Hi! I need advise. Do you know any lib to convert string representation of number(group of words) to number? It's like of intelligent parser that may contain stop words(symbols) cutter, stemming, ets. And it gives you not only result, but smth like rightness index. Of course various culture(languages) support required. ...

Comparing future dates in C#

I know this is probably a pretty simple question, but i am trying to write a function that returns a bool value of "true" if a date passed is in the future, like this: bool IsFutureDate(System.DateTime refDate) { if (refDate > DateTime.Now) // This doesn't seem to work return true; return false; } Anyone tell me who t...

Drag & Drop Shapes on Canvas

Hi, I used MouseDragElementBehavior to let user drag & drop Shapes on a Canvas: MouseDragElementBehavior dragBehavior = new MouseDragElementBehavior(); dragBehavior.Attach(myShape); Now, I would like to know when myShape was moved and when myShape was dropped. Could you please suggest a code that prints the mouse coordinates when mySh...

C# and arrays of anonymous objects

what does such expression mean? obj.DataSource = new[] { new {Text = "Silverlight", Count = 10, Link="/Tags/Silverlight" }, new {Text = "IIS 7", Count = 11, Link="http://iis.net" }, new {Text = "IE 8", Count = 12, Link="/Tags/IE8" }, new {Text = "C#", Count = 13, Link="/Tags/C#" }, new {Text = "Azure", Count = 13, Link="?Tag=Azure" } };...

C# to C#, convenience language features

I'd like to learn what are all the convenience features of C#, and how they map to C#. For example, automatic properties: public string Foo { get; set; } ...maps to something like this: string <Foo>k__BackingField; [CompilerGenerated] public string Foo { get { return this.<Foo>k__BackingField; } set { this.<Foo>k__BackingFie...

Code generation using .net

are there any classes in the .net framework that allow me to generate classes that i can save as .cs or .vb files ? ...