.net

I need to extract the first folder from url

I need to improve the method below. The thing is to extract the first folder of an URL if it exists. The urls that can be pass are with domain or without domain, that is to say: http://www.xxx.com/es/test/test.aspx or http://xxx.com/es/test/ or /us/xxx/xxx.aspx. public string ExtractURL(string url) { string result = ""; try ...

Front-end developer in a .NET world - What do I need to know?

When working on the front-end of a .NET application what are the basic prerequisites? What do I need to know in order to survive, assuming I already have knowledge of HTML/CSS/JavaScript plus a general awareness of the MVC pattern and how it works. Is there anything else? ...

How to cast a Dataset into Strongly Type Object ?

Hello guys, I get some informations in a Dataset, and i would like to cast it in a strongly type object. For example my dataset have : TableName : tab_data Rows : 1 Columns : Name, FirstName, Address So i created a class like : public class Customer { public String Name; public String FirstName; public String Address; } Is there...

SOAP Extension Stream Empty After Serialization

I have had this problem for the last day. I have created a SOAP Extension following the MSDN articles and a load of blog posts but I just can't get it to work. Ok Some code: public class EncryptionExtension : SoapExtension { Stream _stream; public override object GetInitializer(Type serviceType) { return typeof(Encr...

how to implement single sign on in .Net?

What is the best solution to implement single sign on in a .net application? I have googled and found few solutions but I am not very convinced with those solutions. User logs on website1 and then moves to website2. How website2 will know user has logged in? I guess by passing some token in the url which will be checked by website2 in d...

C#: Why can't we have inner methods?

Very often it happens that I have private methods which become very big and contain repeating tasks but these tasks are so specific that it doesn't make sense to make them available to any other code part. So it would be really great to be able to create 'inner methods' in this case. Is there any technical (or even phylosophical?) limi...

C# internal static extern with InternalCall attribute - internal or external?

In another question I asked, a comment arose indicating that the .NET framework's Array.Copy method uses unmanaged code. I went digging with Reflector and found the signature one of the Array.Copy method overloads is defined as so: [MethodImpl(MethodImplOptions.InternalCall), ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayF...

Chilkat C# Crypt2 vs .NET framework encryption

Hi guys, anyone out there who has used Chilkat C# Crypt2 library? How does it compare with the .NET framework encryption library? Any pros/cons? ...

should we use Path.DirectorySeperatorChar C#

A question that's lurking in my head for a while now. What's the importance of Path.DirectorySeperatorChar ? I mean can't we just put '\' instead - which i think is faster than calling a property especially if you're constructing a huge number of paths in your application? Is there a reason for it? could there be another Char for folder...

Detect an object in a camera image in C#

I have an image, taken from a live webcam, and I want to be able to detect a specific object in the image and extract that portion of it to do some further processing. Specifically, the image would be of a game board, let's say for the purposes of this question that it's a Sudoku game board. Here is a sample image. My initial approach...

Global.asax issue

Hello everyone, I am developing an HttpModule and using Global.asax. I have developed a class which derives from HttpApplication, but Application_Start method of my class never executes (I create a file at the beginning of Application_Start but the file never creates, and it is why I think Application_Start never executes). I am using V...

How to let AutoComplete in .NET Winforms 2.0 TextBox suggest even if the user input is contained in middle of of the suggestion items.

How to let AutoComplete in .NET Winforms 2.0 TextBox suggest even if the user input is contained in middle of the suggestion items? ...

Localization — how to check that Filename1 and Filename2 are the same

I want to know that Filename1, provided by the user is the same as stored in DB (Filename2). I was about to use string.Equals(Filename1, Filename2, StringComparison.CurrentCultureIgnoreCase) but then I doubted whether I should use StringComparison.InvariantCultureIgnoreCase. Obviously, I need to do this the same way OS does, or use...

Websites that started using Rails or Django but switched to "enterprise" solutions?

Hi Out of curiosity, I'd like to know if anyone knows of any somewhat large website that started out using Django, Ruby on Rails, or similar frameworks, but later switched to using something more "enterprise-ish" such as .NET or JSP. (I tried searching for this question, but couldn't find any.) Thanks ...

How to make text Bold in asp:dropdownlist

Hi, I have a asp:dropdownlist, which shows below code when page renders <select id="ContactUs_ddlWhichProgrammes" name="ContactUs$ddlWhichProgrammes"> <option value="Select an option">Select an option</option> <option value="InterestOptionBusiness">Business</option> <option value="InterestOptionEnglish">English</option> ...

Is there no way to obtain sender's emailId from outlook calender data using Microsoft.Office.Interop , c#.net

I want to get the sender's emailId. I am able to read all the data of calender by the below code but not the sender's emailId. using Microsoft.Office.Interop.Outlook; Microsoft.Office.Interop.Outlook.Application outlook = new Application(); Microsoft.Office.Interop.Outlook.NameSpace oNS = outlook.GetNamespace("MAPI"); oNS.Logon(Missin...

Best method for implementing Self-Updating Software

We have a minimal 'updater' exe that checks a remote URL for updates, downloads them and replaces files on disk prior to launching the real application. However if we want to replace the updater EXE then AFAIK we have two options: 1) Shadow Copying Assemblies whereby .Net will create a shadow copy of the EXE (and any referenced assembli...

Problem with Entity Data Model in Dynamic Data Web Site

I'm trying to set up a dynamic data entities web site, exactly following the MS walkthrough, but I can't register my model. My web site is called 'DynExtensions', and the model gets generated in the namespace 'DynExtensions.App_Code', but this namespace is not visible in the rest of the project, i.e. I get a compile error if I add a 'us...

"Uncurrying" an instance method in .NET

EDIT: Highlight difficulties with virtual and/or value-type methods Can you create a delegate of an instance method without specifying the instance at creation time? In other words, can you create a "static" delegate that takes as it's first parameter the instance the method should be called on? For example, how can I construct the fo...

Advantages of .NET Rx over classic events?

.NET 4.0 beta 2 has introduced the IObservable and IObserver interfaces. What are the advantages compared to classic .NET events? Doesn't this solve the same problem? ...