.net

Detecting if a PNG image file is a Transparent image?

I am looking for a way to quickly determine if a PNG image has transparent features. Does anyone one know a simple way to detect this? UPDATE: OK, is there a less complicated way then to pull out the PNG specification and hacking code? ...

How to read configuration file from a ASPX?

How could you do to read a web.config file from inside a aspx file? Thanks! ...

Regex - find and replace complete string occurrences only (not partial matches)

I'm not very good at regex but maybe there's a simple way to achieve this task. I'm given a string like "bla @a bla @a1 bla" I'm also given pairs like {"a", "a2"} , {"a1", "a13"}, and I need to replace @a with @a2 for the first pair, and @a1 with @a13 for the second one. The problem is when i use String.Replace and look for @a, it als...

Is there a library for .NET that does parenthesis or expression reduction and optimization?

Is there a library for .NET that does parenthesis or expression reduction and optimization? Something that would take an expression such as (A & (((B) | (C)) | D))) and return A & (B | C | D) But also take (A & A) and return A ...

Adding an attachment to a .NET Email

How do I attach a file with a very unfriendly name (like a file with a session Id number in it) but have it attached as another name? The file name in question has the session ID in it to avoid clashes name on the web server but when I attach it to the file, a friendlier name is preferable. Is there a way to attach the file with the u...

How to achieve maximum callback throughput with WCF duplex channels

I have setup a basic WCF client/server which are communicating via Named pipes. It is a duplex contract with a callback. After the client "subscribes", a thread on the server just invokes the callback as quickly as possible. The problem is I am only getting a throughput of 1000 callbacks per second. And the payload is only an integer! ...

Sef-packed training kit practice tests

Hi I have a book called .Net framework 2.0 application development foundation, self-packed training kit by Tony Northup and Shawn wildermuth. the book CD contains practice tests, Can I rely on this CD to take the exam, or it will be just like the book itself, a wast of money? someone rely on it and success? I am not talking about mem...

Typographic entities in WPF FlowDocument

Is it a way to add to FlowDocument content specific typographic symbols (dashes, greek symbols, etc)? ...

Showing items as images in a WPF ListView

So I have binded a List to a ListView where the List has items of type Album, where it has lots of properties including .Cover, which I is an image on disk. Well since I don't know what type of image is needed and how they have to be loaded (I only know using Image types for Winforms), I don't know the type yet. Can someone show or post...

How to set Content-Type of a Webbrowser Control?

Is it possible to set the Content-Type of a document in a webbrowser control? For example how can I show an XML document rendered as XML in a webbrowser control by using DocumentText? ...

How to deny the move to the next WizardPage in C#.net.

How to deny the move to the next WizardPage in C#.net. ...

Adding items in the combobox dynamically and items added by user should be permanent without using database,is possible ?

Can we add the items in the combobox located on the window form dynamically ? Like there are 7 combobox on the window form and when the application is run user should be able to add the item(s) in the combobox.And items added by user should be permanent in the combobox. ...

Which DB? Linq to SQL classes

Hi. I want to develop a multiuser supporting accounting management application in C#. I want to use Linq To SQL classes. LINQ to SQL only supports SQL Server/Compact. However is it possible the SQLite people have written their own LINQ provider given the name of the assembly. I have to use DBMS that is FREE. Which DBMS do you suggest...

Format date function in .NET

Is there an inbuilt .NET date formatting function to return a date in the format: 3rd April 2010 It's the "rd" bit that I cannot recollect whether there is a formatting option. Cheers, Rob. ...

How to deal with JavaScript when trying to fetch web page in C#.NET/WPF?

The .NET WebClient class is nice and all, but it doesn't parse the JavaScript in the page. What I mean is, sometimes a page is forwarded to a different page via JavaScript, or sometimes DOM elements get added to the page via JavaScript with an onload event. I need to deal with both of these situations. What can I do to deal with this?...

Connection Error:Oracle.DataAccess.Client.OracleException ORA-12170

This has taken many hours of mine. I have to get this .Net app to run on an XP system. Someone seems to have messed up some files so conn.Open() in the C# is causing this error: Connection Error:Oracle.DataAccess.Client.OracleException ORA-12170: TNS:Connect timeout occurred at Oracle.DataAccess.Client.OracleException.HandleErrorHe...

Check if filename Exists? .NET

I find myself doing this a lot just to ensure the filename is not in use. Is there a better way? Directory.Exists(name) || File.Exists(name) ...

Parsing Tabular cell data with space where there is td tag.

I am parsing html tabular information with the help of the html agility pack. Now First I am finding the rows in that table like var rows = table.Descendants("tr"); then I find the cell data for each row like foreach(var row in rows) { string rowInnerText = row.InnerText; } That gives me the cell data.But with no spaces betw...

Is it possible to refactor this C# if(..) statement?

Hi folks, simple question :- i have the following simple if (..) statements :- if (foo == Animal.Cat || foo == Animal.Dog) { .. } if (baa == 1|| baa == 69) { .. } is it possible to refactor these into something like ... DISCLAIMER: I know this doesn't compile .. but this is sorta what i'm trying to get... if (foo == (Animal.Cat |...

Why has to be size of dynamically-allocated array a static field?

I have a dummy class where I am testing arrays. I've noticed that when I want to dynamically allocate size of array at runtime, fields that indicate this size have to be static. I know I should probably use collections for this kind of code, but I'm more interested why do these fields have to be static? Is there any particular reason beh...