.net

Parsing string and making list of required data

hi, I am using **<style>..{data inside}..</style>** which is there in following code.i have taken all the data between style tags in one string ,say string tempStyle and all operations are to be done on that string only. I am looking for function which will take make a list of all "style" data. i.e. only style1,style2,style15,style20 i...

Full Cluster vs Load Balancing

Is there any solutions that "increases power of a single machine" instead of traffic distribution between different hosts. I mean the following schema: "Central server" receives all requests and for its execution it provide "a copy of shared memory" to different hosts. Thanks a lot. P.S. I need that for .NET based web application. ...

load a webpage into a string ...fastest way

How can I load a web-page into a string in .net ? i want the fastest way possible ... ...

How to optimize this linq query?

I have the following linq query: var allnews = from a in db.News where !(from c in db.NewsViews where c.UserGuid == thisUser.UserGuid select c.NewsGuid).Contains(a.NewsGuid) orderby a.Date descending ...

Merge OCX with .NET EXE

Is there any tool, commercial or freeware, that allows merging OCX files with .NET executable? I know it's possible to make an isolated OCX reference, but that's not sufficient in my case, I need to get a single exe without installation requirement. Thanks. ...

Printing from ASP.NET to a network printer

I need to send documents to a network printer (\myserver\myprinter). I'm using the System.Printing classes to print, and it works fine when it's from a Windows Service, but from an ASP.NET app, it's only able to print to local printers, not network printers. The error I'm getting is "Printer Name is not valid" This is what I'm using to...

Logging rewrited url with IIS 7.5

Hi, I'm working on a web site under IIS 6.0 .NET 3.5. I made a custom httpmodule to rewrite our url. It works fine, i do a "rewritepath" in the event "onbeginrequest". In my IIS 6.0 logs i can see my rewrited url. Now my site is under IIS 7.5. I need to keep my custom httpmodule. I can't use the new urlrewrite module from MS. My custom...

How do I handle errors when converting a byte array to image?

This is a C# Winforms App in .NET 4.0. I receive a byte array from a web server which is supposed to be a JPG image. I convert this array to an image as follows: // byte[] ImageData ... bool ValidImage = false; try { MemoryStream ms = new MemoryStream(ImageData); Bitmap FinalImage = new Bitmap(ms); ValidImage = true; } catc...

nhibernate insert question - have id but not entity object

Using NHibernate I need to insert an entity into a database that has a child entity. Example: public class Reservation { public int Id { get; set; } public Service Service { get; set; } } public class Service { public int Id { get; set; } } I need to create a new Reservation and insert it. However, when constructing the R...

What regex could I use to extract a body of XML text from a body of unformatted text?

Let's say I have the following body of text: Call me Ishmael. Some years ago- never mind how long precisely- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is <?xml version="1.0" encoding="utf-8"?> <RootElement xmln...

How to replace " in .NET

Simple! How to replace " in .NET with something...? ...

C# Cookie Login

Hi guys, I'm trying to buffen up my C# knowledge and experience so I am converting a Python script I wrote to C#. The script converts and stores the user's browser cookies into a text file. It then uses them to log into a website that uses WLID stores the new live.com cookies and the websites own user cookies; then scrapping the source ...

Silverlight strange bug with bitmap images and WebClient

I have strange bug with showing image in silverlight. The problem to show list of images that configured in xml file and this xml downloaded from server by WebClient type. WebClient client = new WebClient(); client.AllowReadStreamBuffering = true; client.OpenReadAsync(new Uri(path, UriKind.Relative), new GalleryU...

Looking for a tool to flatten WSDL and its XSD

I have a web service exposed by an external entity that is developed in java. My client is a .Net client. I am unable to create the proxy class for this webservice using WSDL tool it errors out when it tries to read the schema file referenced in the WSDL file as <wsdl:types> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" ...

Interface instances

Hi, I am new to C#.net and was surprised to know that instances of an Interface can be created like Iinterface myDimensions = (Iinterface) myBox; How is memory allocated for this type of statement? Is the memory allocated on heap? Can any one give any situation where this types of instantiations are used. A class that implement...

How to access FaceBook Ads API using asp.net

I wish to access the FaceBook Ads API using the FaceBook toolkit for .NET (which i found in codeplex.com) Wish to access the ads.estimateTargetingStats in particular . details of FaceBook Ads API FaceBook Ads API reference Are there any frameworks(in .NET) developed around the FaceBook APIs . I am aware of FaceBook Toolkit , FaceB...

Parse inbox for non delivery receipts using c# (.net)

Anyone know of a c# library for parsing non delivery receipts in an inbox (and one that categorizes by which type of failure / bounce). ...

Can't tell if user with protected tweets is following me using Tweetsharp

I've used the method indicated here: http://stackoverflow.com/questions/2525791/how-to-see-if-a-user-is-following-you-on-twitter-using-c-twitter-api-wrapper-twe to retrieve whether or not a user is following me, but I've found that if a user has protected their tweets, the script returns the following error: You do not have permissio...

How to make a MessageBox show during a .NET build?

I use a 3rd party control that (if not licensed) shows a dialog box when building a project that references their dll. Although this is super annoying, it made me wonder how they did that? Any ideas? ...

DateTimeFormatInfo.CurrentInfo.LongTimePattern not updating

I am using this to read the current long time pattern in Windows: System.Globalization.DateTimeFormatInfo.CurrentInfo.LongTimePattern However, if I make a change in the regional settings in the Control Panel, this pattern isn't updated until I restart my application. How can I force this pattern to update when the regional settings ar...