.net

Possible to execute jQuery on C# string object?

I am retrieving the HTML source code from a remote URL via C#. I am storing the html in a string. I would like to parse through it, but do not want to use RegEx. Instead of want to leverage the jQuery engine to parse through it. Is this possible somehow? This is how I getting the html from the remote url: HttpWebRequest wr = (HttpWebRe...

.NET Webservice sessions

Hi guys, I'm having some wonders. How's session based authentication designed for webservices ? Imagine I do have a web solution where people can sign up and then log themselves in, then they can do stuff that's processed by webservices (either hosted on the same machine or on a remote server). I know how to manage sessions after log i...

ASP.NET: Question about the column-line-wrapping feature in gridviews

I have a ASP.NET gridview (embedded in a DIV) with several columns. For some columns line wraps are definied and for some not(with ItemStyle.Wrap = true/false). For all columns ItemStyle.Width is set to a specific value. Now I am wondering, that there is a line wrap in a column, where ItemStyle.Wrap = false. What could be the reason for ...

Providing concurrent read and write access to objects through WCF

I have a .NET 4 WCF service that maintains a thread-safe, in-memory, dictionary cache of objects (SynchronizedObject). I want to provide safe, concurrent access to read and modify both the collection and the objects in the collection. Safely modifying the objects and the cache can be accomplished with reader-writer locks. I am running...

Allowing users to create pages

I would like to allow users to create pages on my site. Not full pages, but just content for the default template. I am currently using http://ckeditor.com/ then saving the content into a database. Is this the best way to go about doing this? ...

.NET Why can't I send email?

Here is my code: try { MailMessage m = new MailMessage ("[email protected]", "[email protected]", "Quarterly data report.", "Hello, world."); SmtpClient client = new SmtpClient("smtp.gmail.com", 465); client.Credentials = new NetworkCredential("[email protected]", "password"); ...

After doing HttpWebRequests for a while the result starts timing out

I have an application that spiders websites for information. It seems like after 20-45 minutes of creating HttpWebRequests a bunch of them return timeouts. One thing we do is attach a BindIPDelegate anonymous function to give the request a specific IP since we round-robin through about 150 IPs. I'm setting up the HttpWebRequest object...

Clean up .net project folders before performing backup

I want to do a backup of my Projects folder. It mostly contains sub-folders for .NET projects (VS2005, VS08, and VS10). What should I delete before doing a backup (e.g. TestResults, bin, obj); if there is something I shouldn't delete but should ignore, what might that be; and, most importantly, how best to automate the whole process (I...

Getting the string from IronPython source code with C#

The book of IronPython In Action has the following code to read python script into a string. (Chapter 15.2) static string GetSourceCode(string pythonFileName) { Assembly assembly = Assembly.GetExecutingAssembly(); Stream stream = assembly.GetManifestResourceStream(pythonFileName); StreamReader textStreamReader = new StreamRe...

Unity with a Linq to Sql DataContext. RegisterType or RegisterInstance

Here's the basic setup. On an ASP.Net website, there are a few pages that display reports from data that comes from a database. All the data comes via stored procedures that is accessed usign Linq to Sql. These pages may have some very high traffic at different times. We're using ASP.Net with the MVP pattern, and Unity for IoC (although ...

Socket.Accept() causes a one second TCP/IP connect

When using CasiniDev fiddler shows a one second TCP-Connect for each connection from a browser. it's always exactly one second maybe few milliseconds up or down, that's why I think it might be a configuration somewhere. the thing that I can't make any sense out of is when I use System.Net.WebClient.DownloadString() in a loop without fi...

Observable<string> updated events?

I'm just trying to do a simple event handler on a string variable, so that if the string changes, it will do a Console.WriteLine (using the new Reactive library from MS (Rx)) The issue that I have is that it will display the first bit when I instantiate the class ("RandomGuid : Mine?"), but after that, none of the stuff I change after...

How to list the currently logged on users when there are more than one at the same time?

Using WMI (regardless of the actual programming language), it's possible to get the currently logged on user using a query such as Select UserName from Win32_ComputerSystem. All nice and good. But what if multiple user sessions and/or Terminal Services are involved? Is it possible to list all the currently logged on users on a given sys...

reverse-engineering dependencies between .NET dlls

Hi, I have two .NET dll's, where one calls some methods located on the other. I need to know what methods exactly are being called between those two dlls to map the dependencies between these two dlls. (No public interface is available). Any idea which tool does the job? ...

Calling an asynchronous method serially

I have the following (simplified) asynchronous method: void Transform<X,Y>(X x, Action<Y> resultCallback) {...} and what I want to do is transform a list of Xs into a list of Ys. The problem is that even though the Transform method is asynchronous, it has to be called serially (i.e. I have to wait for the callback before calling it w...

Does Watir work with Ironruby(or .Net in any other way)?

So I've been trying to get Watir setup with Ironruby so I can use Watir instead of Watin(I just dont like Watin that much), the only issue is I cant seem to get it working, and searches bring me to some conflicting info. Some say it wont work, others say use igem. Right now I'm running VS 2008(3.5), and Ironruby 1.0. Every time I run ...

How does QT4 compare to .Net

Just curious. Does anyone have experience with both. My gut feeling is that QT is better for cross platform applications but the UI won't be as slick. Also is QT faster since it compiles to native code with no Virtual Machine? I think also QT is C++ so unmanaged, so there is more chance of memory leaks etc? If I wanted to develop a non ...

Visual Studio crashes when opening solution: Rejecting native image because dependency is not native

Hi, I am working with a solution that contains an ASP.NET website and class library project. It has been working splendidly for years. In the past few months I upgraded it from VS 2005 and .NET 2.0 to VS 2008 and .NET 3.5. During the upgrade process I noticed know issues and it runs fine in production. After pushing to production and ...

What is the difference between web application and web site?

I want to know what is the difference between web application and web site exactly? Because I feel in trouble, as I want to integrate tasks. Part of them are built as a web site, and the other as a web application. When I added them to the web site and build the solution, I had many errors that I could not handle. It can't handle name sp...

Controlling the Threading Model of COM objects served by .NET Out of Process Servers

When creating an out-of-process COM server in C# as documented in Microsoft's All-In-One code sample: CSExeCOMServer, it seems difficult to control the threading model of objects that are created in the server (by a client). The object being created needs to be in an STA due to the fact that it uses WPF objects, and it's factory is bein...