.net

Question about Multicast Delegates?

I am going through some exam questions for the 70-536 exam and an actual question one developer posted on his blog has popped up in my exam questions. I cannot remember what his answer was .... but below is the question: You need to write a multicast delegate that accepts a DateTime argument and returns a bool value. Which code segment ...

Windows Identity framework with windows XP

How can use the Windows Identity Foundation SDK with Windows XP ? ...

OpenArchitectureWare in the .NET world?

Is there some kind equivalent of OpenArchitectureWare in the .NET world? ...

Storing a reference to an object in C#

I was wondering how one could store a reference to an object in .net. That is, I would like something like the following code (note, of course, that the following code may be way off from how to actually do it): class Test { private /*reference to*/ Object a; public Test(ref int a) { this.a = a; this.a = ((i...

WCF 3.5 - Remove SVC Extension - Special Case

I have several RESTful endpoints like such: System.Security.Role.svc System.Security.User.svc etc. This is meant to be a namespace so our RESTful URL's would look like: /rest/{class namespace}/{actions} I have tried a few examples to get the SVC extension removed when my endpoint has multiple periods in it, however, nothing seems t...

Retrieve user's messages from facebook account

Hi! I trying to retrive user's messages using fql query, I have this code string fqlOutput = MainForm.stFacebookService.Api.Fql.Query("SELECT author_id,thread_id,body FROM message WHERE thread_id in (SELECT thread_id FROM thread WHERE folder_id = 0)"); XDocument xml = XDocument.Parse(fqlOutput); ...

REST, HTTP verbs and current development in .NET and silverlight

Hi, I've read several posts in the internet about that Silverlight only supports GET and POST, and that the most of the web browsers too. Is this true? has it changed lately? I'm developing a RESTful web service for a Silverlight application, still in early stage, and I'd like to know if I should use just POST and GET, or otherwise I co...

VB.NET/C# Comparison Operator for to test for set membership - like the IN Operator for SQL...

so in SQL you can do something like: WHERE title IN('title1','title2','title3') to test for set membership (assuming i'm using the right phrase here). how can I do this in VB.NET/C#.NET? Example: IF textMyTitle.text IN ("title1","title2","title 3") THEN 'Take Action End If Obviously the IN part of that statement doesn't work.....

Are there any performance or contention considerations when using VB.Net "Shared" or C# "static" classes and methods?

I have a C# class library behind a WCF service. The library contains ClassA which is declared as static. This static class has a method MethodA which accepts a string and uses LINQ to query the database for a translation of the string which it then sends back through the webservice to the client. My question is whether using a s...

How do I subscribe to a MSMQ queue but only "peek" the message in .Net?

We have a MSMQ Queue setup that receives messages and is processed by an application. We'd like to have another process subscribe to the Queue and just read the message and log it's contents. I have this in place already, the problem is it's constantly peeking the queue. CPU on the server when this is running is around 40%. The mqsvc.e...

Create a Font using strings pulled from a string table.

I am writing a tool to create an otf or ttc with only characters defined in our localized string table, so we can cut down memory usage. I already have the information for the Japanese characters we are using but I am unable to find an example of creating a new font based around these characters. Does anyone know of a good example or ev...

List of Input Values which will cause the "A potentially dangerous Request.Form value was detected..." error

I know the < and > characters will cause this error, but what other characters/inputs will cause this error? I'm testing for this error in the Global.asax, and reridrecting to an error page where I want to list all possible values which cause this error, so the user can go back to their page and get rid of them. I've done some googling...

WCF REST Does Not Contain All of the Relative File Path

I have a RESTful WCF 3.5 endpoint as such: System.Security.User.svc This is supposed to represent the namespace of the User class and is desired behavior by our client. I have another endpoint I created for testing called: Echo.svc I am writing an overridden IHttpModule and in my module, I follow what almost everyone does by doing...

What are ProductCode & UpgradeCode & GUID? How to detect if certain application/library is already installed on the user machine?

I've already gone through: http://stackoverflow.com/questions/211192/check-if-the-application-is-already-installed http://stackoverflow.com/questions/488717/detecting-if-a-program-is-already-installed-with-nsis http://nsis.sourceforge.net/Add_uninstall_information_to_Add/Remove_Programs My questions are little more in dep...

Is there a receipt scanner with a .net api I can use to integrate into my app?

I need to find a receipt scanner (Similar to the Neat Receipts scanner) that can be portable and that has an API which I can integrate into my app. I also need a PEN barcode scanner with a modifiable API. IF you know of any one of these items, I would sure appreciate some feedback. ...

How can I process a form's events in another class / module automatically in VB.NET

Here's my code: Public Class Form1 End Class Public Class Form1Handler Inherits Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click MsgBox("I") End Sub End Class I'm trying to get Form1Handler to process Form1's events automatically. How can I do this?...

Initial capacity of collection types, i.e. Dictionary, List

Certain collection types in .Net have an optional "Initial Capacity" constructor parameter. i.e. Dictionary<string, string> something = new Dictionary<string,string>(20); List<string> anything = new List<string>(50); I can't seem to find what the default initial capacity is for these objects on MSDN. If I know I will only be storin...

Automated browser testing: How to test JavaScript in web pages?

I am trying to write an application that will test a series of web-pages programmatically. The web pages being tested have JavaScript embedded within them which alter the structure of the HTML when they complete execution. It is then the goal to take the final HTML (post-execution of the embedded JavaScript) and compare it against a know...

how to read http response soap headers from web service response in proxy class

I'm having some problems with one webservice that i'm working with. I generated a proxy class with wsdl.exe that comes with .net framework. But that webservice return a header that isnt not mapped by the wsdl. I must map the header sop because it contains some properties that i have to read and work with. how can i read the soap's header...

Loop through enumeration

What is best way to loop through an enumeration looking for a matching value? string match = "A"; enum Sample { A, B, C, D } foreach(...) { //should return Sample.A } ...