.net

c# - StreamReader.ReadLine does not work properly!

Simply I have been trying to implement what BufferedStreamReader does in Java. I have a socket stream open and just want to read it in a line oriented fashion -line by line. I have following server-code while (continueProcess) { try { StreamReader reader = new StreamReader(Socket.GetStrea...

authentication issue of IIS 6.0

Hello everyone, I am using Windows Server 2003 + VSTS 2008 + .Net 3.5 + C# + ASP.Net + IIS 6.0. I host some files (wmv video file and html file) on the web server, I want to know whether there are any easy to use authentication approach to let user input username and password before they can access (I want to prevent anonymous access)? ...

C# Recycle IIS 6's App Pool error

I want to Recycle IIS 6's App Pool in a web app using asp.net c#. protected void Page_Load(object sender, EventArgs e) { //Recycle IIS 6's App Pool Recycle("localhost", "appPool_02"); } void Recycle(string machine, string appPoolName) { string path = "IIS://" + machine + "/W3SVC/AppPools/" + appPoolName; DirectoryEntr...

Will Apple bundle the Mono Touch runtime with every iPhone?

It strikes me as a good idea for Apple to negotiate with Novell and bundle the Mono Touch runtime (only the runtime of course) into every iPhone and iPod Touch. Perhaps even make it a "one time install" that automatically gets downloaded from the App Store the first time one downloads an app build with Mono Touch, making every subsequent...

How to create a cookie for login? Or should I stick with asp.net membership?

Hi I am using asp.net MVC with the asp.net membership but I starting to think that there is no point for me to use Asp.net membership. So I would like to figure out how to generate the same type of cookie with the same fields and the one the asp.net membership one does. Also is there any other settings I need? Like how about stuff lik...

Show items in an itemscontrol in two columns (WPF)

I have an items control that is bound to a collection of objects. The object has two properties (name, value) that i display in a textblock and textbox respectively. The list is quite long and I would like to show it in two columns. So my question is, is there any way I can get an Itemscontrol to show its items in two columns? P.S: The ...

Using System.Web.Script.Serialization.JavascriptSerializer to deserialize JSON - how to?

Note: I posted a similar question, which was the ancestor of this question, as I was originally thinking of using JSON.NET to parse the JSON, but I'm using the built-in deserializer, so it's a different question. This is what I'm trying to do: I have a class called Item, for example. The json has many "elements" (if that's what they are...

.NET Framework Namespaces?

What is a really good book that lists and explains all the namespaces of the .NET framework. version 2 (3/3.5 is a plus)? ...

PNRP Global_ stuck on Alone

Hi, I have two installations of Windows 7. a 64bit version on my hard disk, and a 32bit version installed as a bootable VHD. on my the 64bit version, I can't get my PNRP Global_ cloud out of Alone state. on my the 32bit version, I can get it in Active state by registering a peer however I can't resolve a friends peer, maybe I misunders...

Problem connecting to java ws

Hi, I've created EJB Stateless Bean and have added @WebService, @WebMethod annotations to be able to access it as web service. I am using NetBeans and GlassFish. When I tested web services with server console they worked as expected. Next I've created .net application which is supposed to be client for my web service. The problem is whe...

How to set custom "Host" header in HttpWebRequest?

How can I set a custom Host header in HttpWebRequest? I know that normally this class doesn't allow you to do so but is there anyway to use reflection or something like that without actually need me to send the whole packet with TCPClient? ...

"Access to the path ... is denied" (.NET C#)

Hi! I've been saving a small XML data file to an external drive, no probs. But then I tried to use the ApplicationData folder and others, even C:\ but no luck. I'm getting an error like "Access to the path "C:\" denied". Just to confirm, the file is created and read fine with the current code, to an external drive. I guess this is some...

Linq2SQL "or/and" operators (ANDed / ORed conditions)

Let's say we need to apply several conditions to select from a table called "Things" (unknown count and nature) if conditions are known, we can write db.Things.Where(t=>foo1 && foo2 || foo3); but if we have to build that Where condition programatically, I can imagine how can we apply ANDed conditions IQuerable DesiredThings = db.Thi...

resolving circular dependencies with dependency injection

I've seen several articles on various websites that propose resolving circular dependencies between .NET assemblies by using dependency injection. This may resolve the build errors but it's not really resolving the circular dependency, is it? To me, there seems to still be a logical error in the architecture. Am I crazy or do others a...

How to automatically update application

Hi, I am writing a c# application. I need to integrate update feature to this application (ie, the application should check if a new update is available and should update to new version if available). How can i do that. Thanks ...

Uploading files via email to Windows Azure

I'm thinking of allowing users to upload files via email to an app on Windows Azure. Is there a way to do this? ...

AES Encryption in .net

How can I use AES in C# .NET to encrypt a file and then securely remove the local copy of the file? Can someone please point me to a good example on how to do this. Is AES the strongest encryption available in .NET 3.5? ...

Is there a .Net API for querying the Windows 7 Media Center Program Guide?

I'd like to query the Windows 7 Media Center Program Guide from a C# app. e.g. to answer questions like "What time is The Inbetweeners next showing on Channel 4?". I've looked through the Media Center SDK (v6 and v5) but this suggests it is only possible to use the Microsoft.MediaCenter.TV.Scheduling classes to request recordings ("Clic...

DDD Modeling question

Hi, I have these two structures in my domain: Exercise (with subjects, solution, difficulty ext.) and Subject which has a name and a father subject. Subject is defined by its attributes so in that sense it's a value object, However even if my current data store has nothing associated with a particular subject, that subject existence sti...

How should I make this? With an Table cell Html helper or some other way?

Hi I am using asp.net mvc and I am not sure how to approach this problem. I have a table in my database and that has some fields in it. I want to generate a table with this. So I first tried to make a html helper that would make the table and and all the stuff I need but I am finding it too hard to maintain and causing problem for the ...