.net

GSM modem library

I'm looking for SMS library that is written in c#, anyone the best library for it and it's free ? I can find more than 1 in Linux, but I'm can't found anything that is written in c# and free ...

OSS Twitter Clone written in .NET

Does anyone know of a twitter clone written in .NET (or ideally C#)? I wanna experiment with a private twitter network between some friends and work colleagues. ...

Is disposing this object, enough? or do i need to do more?

Hi folks. I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. } Do I need to put this line of code, just BEFORE I leave that dispose scope .. or does the dispose 'call' that already. sha2.Clear(); ...

Generics and System.Collections

After moving to .NET 2.0+ is there ever a reason to still use the systems.Collections namespace (besides maintaining legacy code)? Should the generics namespace always be used instead? ...

LinqToSql and the DataContext 101

I'm looking for a good article or two, or just an explanation, on how the DataContext, or dbml file, for LinqToSql, exactly works in LinqToSql. Is this a disconnected environment? Are the database connections still pooled by Sql Server? If I create an instance of my DataContext am I responsible to Dispose of it? How does it handle a mu...

What have your experiences been with Entity Framework?

EF has been out for awhile now and I'm considering evaluating it - what have your experiences been? I am interested in both web and desktop applications, and maybe some comparisons between EF and other ORM tools that you've used. Learning curve is a factor since there is a team involved. Is this thing a bloated mess, or it is lean and...

FileNotFound exception when using XmlSerializer

When trying to serialize a type (a generic List<T> which T is a class marked with XmlRootAttribute) into XML using XmlSerializer, a FileNotFoundException is thrown (sometimes) and serialization fails. It seems that XmlSerializer tries to create a temporary file with a random file name in the Temp folder of user under which the applicati...

What is the difference between CurrentCulture and CurrentUICulture properties of CultureInfo in .NET?

In .NET there is the CultureInfo class in the System.Globalization namespace. It has two similar properties both returning values of the CultureInfo type: CurrentCulture and CurrentUICulture. What is the difference between them? Which one should I use when and why? ...

How can I conditionally compile my C# for Mono vs. Microsoft .NET?

I need a conditional compilation switch that knows if I am compiling for the mono or MS .NET runtime. How can I do this? ...

What's the rationale behind IEnumerable?

Why do you think Microsoft wants us to go through IEnumerable to get to IEnumerator? Isn't the presence or absence of a valid cast to IEnumerator for a given type enough to determine if the type is enumerable or not? For example whats wrong with the following? class MyClass : IEnumerator { ... } MyClass myObj = new MyClass(); if(myO...

ASP.NET Authenticate Using [Authorize]

I defined a Controller to force authentication by using the [Authorize] attribute. When a session times out, the request is still passed down and executed instead of forcing a redirect. I do use FormsAuthentication to login and logoff users. Any ideas on how to control that? Example: [Authorize] public class ProjectsController : Con...

Detecting (unknown) hardware in .NET

I need some pointers on how to detect unknown hardware using .NET and C++/C#. I'm looking for the technique to use under NET to do this. What I basically want is to identify the PCIID/USBID and so on for all the hardware in the machine. Of course I also need this for the hardware that doesn't yet has a driver installed. I believe this ...

REST web services and .NET

What's the best way to consume REST web services from .NET? ...

Cannot delete directory with Directory.Delete(path, true)

I'm using .NET 3.5, trying to recursively delete a directory using: Directory.Delete(myPath, true); My understanding is that this should throw if files are in use or there is a permissions problem, but otherwise it should delete the directory and all of its contents. However, I occasionally get this: System.IO.IOException: The direc...

SmtpClient class not picking up default parameters from Web.Config file.

config file : <system.net> <mailSettings> <smtp from="[email protected]"> <network host="mail.xxxxxx.com" port="25" password="password" userName="[email protected]" defaultCredentials="false" /> </smtp> </mailSettings> </system.net> I've already tried defaultCredentials="true" but i recieved following message: System.FormatException: Sm...

What .NET language you use to write Unit Tests?

In the past I wrote most of my unit tests using C# even when the actual software development was in another .NET language (VB.NET, C++.NET etc.) but I could use VB to get the same results. I guess the only reason I use C# is because most of the examples in the internet are written in C#. I you use unit tests as part of .NET software dev...

How do you copy from a rectangular source region to a non-rectangular/non-paralellogram destination region in .NET?

I know how to use the DrawImage() method of the Graphics object to copy from a rectangular source region to a rectangular destination region, and how to copy to a paralellogram region defined by a three-element Point[] array. Is there any way in .NET to copy from a rectangular source region to a 4-sided non-rectangular destination regio...

How do I find out the name of the current controller/action/view?

I have some code that I am putting in the code-behind of a master page. This master page is my main layout and the purpose of the code is to check whether the user is logged in and take the appropriate action depending on whether they are or not. I would be interested in hearing alternate methods on how to approach this, but I am doing i...

How to display a progress bar on top of a control in WPF

Hello all, In a WPF UserControl, I have to make to call to a WebService. I am making this call on a separate thread but I want to inform the user that the call may take some time. The WebMethod returns me a collection of objects and I bind it to a ListBox in my UC. So far, so good... This part works really well. However, I want to dis...

Where to find the status of the WPF Image Control?

Hello all, One of the nice feature of the Image control is that we can specified an Uri as the ImageSource and the image is automatically downloaded for us. This is great! However, the control doesn't seem to have a property indicating if the image loading is in progress or not. Is there a property telling us the status (Downloading, D...