.net

Looking for the exact list of possible MethodAttributes.SpecialName.

I am aware of ctor, cctor, property/indexer prefix: get_, set_, event management prefix: add_, remove_. I have seen a raise_ prefix once or twice (do not remember where). Does a definitive list exists at the .Net level (ECMA spec.)? If yes where is it? Is it an "open list" so that any (new) language can define them for its (future) nee...

How can I get the name of the current (WLAN) network in C#?

Hello, could someone help me by getting the name of the current connected (WLAN) network in C#? Or, in addition how can I see if this network changed? Thank you! ...

Random Questions using DetailsView (Help)

Greetings everyone, i would just like to ask how do i retrieve data rows in my table in my database randomly... i was able to create an online quiz wherein it displays the question,choices in consecutive order but what i want is, every time when user will start a quiz it will show questions in random order. I am using mssql 2005 as my d...

Button in main menu in a Pocket PC application in .NET

Hi, I am creating an application for a Pocket PC 2003, using Visual Studio 2008 and Compact Framework 3.5. I want to add a button to the main menu bar (like the Back and Refresh buttons in Internet Explorer for Pocket PC). I do know how to add textual menus and submenus, but I don't know how to make those menus graphical. Thanks in adv...

Difference between NHibernate SessionFactory and EF 4.0 ObjectContext

In NHibernate SessionFactory is said to be a heavy object and it is suggested that SessionFactory should be created once in application life span. However once we get handle to SessionFactory, we do call open() on it before doing any DB operation. In EntityFramework we need to create an object of ObjectContext every time before doing an...

wsdl.exe : how to generate proxy code when having same element name in operation?

Hi All, I have a single WSDL file with many operation. But each of the operation soap body has the same element name , but in different namespaces. e.g operation1 has soap.body.op1:Service and operation 2 has soap.body.op2:Service , where op1 and op2 are namespace prefixes. When i generate my proxy code using wsdl.exe , he generated cl...

Adding a static ResourceDictionary to UserControls before the XAML is parsed

Hello community, I have one WPF control that I want to use in my WinForms application (using an ElementHost) in several places (=> multiple instances of this control). Furthermore I want all instances of my UserControl to share one single Instance of a ResourceDictionary. In WPF applications I would achieve that by merging my Resource...

Testing a WCF web service

Hi All, I have written a commercial WCF web service. I would like to give the service to another person to test independent of the application that will be using the web service. This is because a third party is going to be building that app and we don't have access to it at the moment. Another thing to remember too is that the person...

Cannot get the WCF Test Client to work

Hi All, I am using the WCF Test Client. When I go to 'add service' and select a service to add I get this message, Assembly Microsoft.ApplicationServer.Hosting, Version 1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 was not found. Reinstall the assembly or Visual Studio. The application cannot continue and will exit. The se...

Problem converting .ico in byte array to Image object

I am trying to take favicons and add them to a dynamic image that I am creating. See StackFlair. The website code works fine locally, and on one shared hosting server. blah blah, free hosting plan, you get what you pay for, blah blah My trouble is that I get an exception from a new hosting setup. This exception only happens for .ico ...

Regex to find unqoted commas?

I'm thinking we can look for an even number of quotes to the left, and to the right of the comma... but I'm not quite sure how to write it. Anyone know? Actually..you'd just have to check either (left or right). I want to split on this, so it has to match only the comma. Example: one, "two, three" Should be split into two strings: ...

VB.Net Search namespace for a generic type (Reflection)

Hi, I'm attempting to dynamically register entities and configurations with a context (ef4 code-only) I would normally do: Private Shared Sub ConfigureDatabase(ByRef Builder As ContextBuilder(Of ContextExtension)) 'Load configurations for each of the tables (Entity sets) in our database... ConfigureEntity(Builder, New ContactConfi...

ActiveX object is not receiving fired events

i, I`ve written a class A and implemented it in an Active X object (AXObj). Class A should also receive events fired from another object(O2). O2 is created inside A and I use EasyAdivse to connect the two objects, i.e. O2 is the event source. I know O2 is exists because I am able to directly call functions that O2 implements from with...

C# Exception when remotely connection to SQL Server 2005 instance

Hi guys, Trying to connect to a SQL Server 2005 instance remotely but getting the following exception: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow r...

Component or Source for Running an FTP Server via C# (with SSL)

I'm surprised by the lack of products out there for running your own FTP server in managed code. I'm looking for either a product or thorough source code for building an FTP server in C# that supports SSL. I need complete control over the directory/file handling, not just serving files from a local directory. Clever Internet .NET Suite ...

How big is an object reference in .Net

Apologies if this has been asked before - searching SO for the terms "object reference" primarily returns page after page of questions about NullReferenceException. What is the size of an object reference in .Net? Does it vary between x86, x64, and/or AnyCPU compilation? If it makes a difference, I'm personally interested in C#. ...

How to build an smtp server?

I'm interested in writing a SMTP mail server that just sends emails? I would be writing this in C# as a stand alone application. So if anyone can point me in the right direction or explain how an SMTP actualy sends out emails that would be great. ...

Help with regex: Anything inside a tag

Hello, I need to find anything inside a tr... <tr class="class1"> more tags here, multiple lines... </tr> How can I get anything that's between <tr class="class1"> and </tr>? thanks! ...

Need to parse a xml string

Hi I need to a parse an xml string(.NET, C#) which , unfortunately, is not well formed.. the xml stream that i am getting back is <fOpen>true</fOpen> <ixBugParent>0</ixBugParent> <sLatestTextSummary></sLatestTextSummary> <sProject>Vantive</sProject> <ixArea>9</ixArea> I have tried using a xml reader, but its crashing out because it...

What's the safest way to launch an untrusted URL?

It seems that the generally accepted approach to launch a URL is to call Process.Start, e.g. var url = new Uri(uriString); Process.Start(url.AbsoluteUri); e.g. this was suggested here. The problem with that is that if the URL is untrusted, bad things can happen. e.g. if the string is @"c:\windows\system32\notepad.exe", the code abo...