.net

What's wrong with this XPath query?

I'm trying to select nodes from an rss feed. It works fine for Twitter, but I can't do it on Youtube. string youtube = "http://gdata.youtube.com/feeds/api/users/CTVOlympics/uploads"; string twitter = "http://twitter.com/statuses/user_timeline/ctvolympics.rss"; //this populates the XmlNodeList object Xml...

RegEx Problem using .NET

I have a little problem on RegEx pattern in c#. Here's the rule below: input: 1234567 expected output: 123/1234567 Rules: Get the first three digit in the input. //123 Add / Append the the original input. //123/1234567 The expected output should looks like this: 123/1234567 here's my regex pattern: regex rx = new regex(@"((\w{1,...

How can I improve this exception retry scenario?

I have a web service method I am calling which is 3rd party and outside of my domain. For some reason every now and again the web service fails with a gateway timeout. Its intermittent and a call to it directly after a failed attempt can succeed. Now I am left with a coding dilemma, I have code that should do the trick, but the code lo...

C# Book or Resource for VB.Net developers?

Bascially, i'm looking for a book or resource to learn C#, given that i already know VB.NET and have known for years. What I'm Not looking for: Now, just to be clear, i'm not looking for VB6 to C#.Net content, as i know there are a few of those out there. Also, I know about that "syntax\conversion table" website, where it compares VB....

Finding the name of a particular property of a class from within the class in C# 3.5

Give a class like below, how can i find the name of one particluar property? public class Student { public int Grade { get; set; } public string TheNameOfTheGradeProperty { get { return ???? } } // More properties.. } So i would like to return the st...

Proper way to determine the number of lines in a file in .NET

This questions is really simple, and probably you .NET gurus now the answer =) So here it comes... What is the proper way (.NET language independent to determine the number of lines (non-blank) exists in a text files without having to check until the line is empty (My current approach)? Thanks in advance ...

Autocomplete Search Component for TextBoxes in ASP.NET

I'd like to use a component similar to the Tags autocomplete component used by Stack Overflow in my ASP.NET 2.0 application. What can I use? ...

Suggest a Online repositories & project management tool for a project in Asp.net

Our team doing a project in asp.net & Mssql 2005.since our team member are distributed. we need a online tool for tracking project changes, and control access to our online code repositories. While searching i got tools like http://codesion.com , http://repositoryhosting.com is project mangement possible using http://codesion.com , ht...

"Padding is invalid and cannot be removed" -Whats wrong with this code?

Every time I run this and encrypt, the output is variable, and when I attempt to decrypt I get "Padding is invalid and cannot be removed." Been fighting with this for a day or two now and I am at a loss. private static string strIV = "abcdefghijklmnmo"; //The initialization vector. private static string strKey = "abcdefghijklmnm...

DotNet Reflector - why can't I disassemble XmlHierarchicalEnumerable ?

Note that the following are examples of the rare cases where dotNet reflector does not disassemble correctly. In the vast majority of cases it works perfectly, and I am not suggesting this is necessarily a bug in reflector. It may be a result of protection or obfuscation or unmanaged code on the assemblies in question. I try to disasse...

What is the "Standard" way to store application state for windows mobile applications?

I am developing my first windows mobile application and would like some guidance on the best way to save and restore application state between invocations of the applications. My application will have a small number of properties, between 10 and 20, that I wish to store when I exit the application and restore when I restart. My option...

EF 4.0 Code only assocation from abstract to derived

Using EF 4.0 Code only i want to make an assocation between an abstract and normal class. I have class 'Item', 'ContentBase' and 'Test'. 'ContentBase' is abstract and 'Test' derives from it. 'ContentBase' has a property 'Item' that links to an instance of 'Item'. So that 'Test.Item' or any class that derives from 'ContentBase' has an...

Set default area - Avoiding `, new {area = ""}` on each link on the site.

This code is inside the master page: <li><a href="<%=Url.Action("Action", "Controller") %>">Main site link</a></li> <li><a href="<%=Url.Action("AreaAction", "AreaController", new {area = "Area"}) %>">Area link</a></li> All the links works good till I'm going to the Area Link. When I go there all the routes of the main area don't wor...

What the best way to save/load Windows Forms ToolStripMenuItem

I have several checkboxes within ToolStripMenuItem within a window form. I need to setup the registry (I think this automatic when saving, correct?) I need to save the checkboxes into registry (during form.closing event) I need to load the registry and set the checkboxes when form is loaded. I would like an option to save it to...

Is there an .NET alternative for Java artifact repositories like Nexus or Artifactory? Where do you store versioned DLL's?

Where to store binaries needed for automatic builds on Team System? Are you storing them along with the code in the SCM or someplace else? Is having a big amount of binaries in SCM causing any performance issues with source controol? There is a need to be able to revert to earlier version of some external library in order to fix bugs in...

compressing and decomressing in .net endsup with an decompressed array of zero's

I'm trying to compress and decompress a memory stream to send it over an tcp connection. In the following code snap I do do the decompressing right after compressing to get it working first. What ever I do I end up with a devompressed buffer wit all zero's and in the line int read = Decompress.Read(buffie, 0, buffie.Length); it seems th...

Upload FTP file to remote site from memory using C#

Am working on a project that requires uploading xml file to remote FTP site. Is it possible to save xml string from memory to remote FTP site? ... from what i see i have to first write the file to local disk then read from disk and FTP to remote site. I am using c#. Thank you. ...

regsvr32 giving error : application configuration file incorrect , how to resolve ?

I have a .net dll which is actually a .NET wrapper for COM , i dont have source of it its third party , when i tried to register it using regsvr32 it gives error application configuration file incorrect , resintalling may resolve problem i checked with Dependency Walker all referenced dlls are loaded also VC++ run time dlls msvcm...

How to Xml serialize a LinkedList?

.NET 2 Actually there are methods to XML serialize a List<T>. What if I have an object that has a public LinkedList<T> member? Without creating a public duplicate as List<T> from LinkedList<T>. Maybe a way to control the Xml serialization like binary (OnSerializing, OnDeserializing). Will be impossible to XML serialize a object with ...

Typed Configuration Values / Variables in .NET

We have lot of configuration files used in our application. Atleast 100 different xml files for each customer containing at least 50-80 name/value pairs of configuration and all they are often change (atleast every month). The configuration file looks something similar like below, <property id="url" value="s123"/> <property id="in...