.net

Best approach to authenticate the client certificate

Hi, I have hosted a secure WCF service on cloud with a certificate created by makecert. Now I want to restrict the access to the service by allowing only those clients who have the certificate generated by me. What is the best approach to implement this * Shall I go with the changes in the configuration file * Or Shall I write the c...

Help needed in XML Serialization.

I am trying a write a program to serialize a object to a xml file. [XmlRoot ("Person")] public class person { [XmlElement("Name")] public string name { get; set; } [XmlElement("Age")] public int age { get; set; } [XmlElement ("Location")] location _location = new location { city...

Does wsHttpBinding for WCF supported on Azure?

Hi I want to host a secure WCF service on azure using wsHttpBinding binding. On the blogs and various posts is ti mentioned that wsHttpBinding is not supported on cloud. Is is true? Can't I use wsHttpBinding with WCF service to host it on Azure. ...

How to manage users with interactive logon rights?

Can anyone tell me how I can manage(or if not possible, monitor) programatically the people who are allowed to interactively logon(that is through actual physical access) on a windows machine attached to an active directory architecture? Something in BCL/FCL is preferred but COM interop/WMI is also fine. ...

PHP ZipArchive Unzipped 0-byte files

hi, I have this problem using PHP ZipArchive to unzip certain .ZIP files that get unzipped but with 0-bytes. I can unzip the same .ZIP file manually and the file is OK. The .ZIP files were produced using VB.NET zip functions from the client. I wonder if there's any incompatiblity issue between PHP and .NET when it comes to zipping/unzi...

Why can't I create an object greater than 2GB in size in .NET, even on x64?

After reading Are C# Strings (and other .NET API’s) limited to 2GB in size? I played around with large strings and arrays in .NET 3.5. I found that the largest array I could allocate was int.MaxValue - 56 bytes. Similar thing for strings: the largest I could get was (int.MaxValue - 58) / 2 characters (since each character took 2 bytes). ...

How can I programmatically launch visual studio and send it to a specific file / line?

I have a nice tidy way of capturing unhandled exceptions which I display to my users and (optionally) get emailed to myself. They generally look something like this: Uncaught exception encountered in MyApp (Version 1.1.0)! Exception: Object reference not set to an instance of an object. Exception type: System.NullReferenceExcepti...

CallContext in WCF

Hi, Is is safe to use CallContext when request arrives to WCF service, initialize it with some call specific data (for instance using hook at the beginning of call: Inspector/ContextBoundObject), and then reuse it in the call, and be guarantied that data I access is all the time the same data? Thanks, Pawel ...

on use of window.showModalDialog no buttons of parent window work

hi, i have a asp.net application and have a requirement to implement a new functinality on a existing aspx page. Let us say i have pageA.aspx, i have to add a new button to this page which will invoke a modal window pageB.aspx. I have added a new HTML input button ("show image"), and on the onClick event i call a javascript function. ...

First HttpWebRequest in a fresh AppDomain is slow, but not always

I'm trying to understand a performance issue I'm having when creating new AppDomains and executing HttpWebRequests in these. Have a look at my Host.exe: private static void Main(string[] args) { for (int i = 0; i < 3; i++) { AppDomain domain = AppDomain.CreateDomain("Foo"); try { Console.Wri...

Cross-platform graphics 3D with .NET

I'd like to program a .NET app that provides a 3D render of an animated world. I'm coding on a Windows PC, but many of my target audience will be on Linux. There are a bunch of frameworks out there that look useful, categorised into high and low level as best I can: Low Level Graphics OpenTK Tao Framework seems to have been supersed...

Is "convert.tobase64string" in .Net equal to "base64_encode" in PHP?

Can any one please let me know, Is convert.tobase64string in .Net equal to base64_encode in PHP? ...

extract last match from string in c#

i have strings in the form [abc].[some other string].[can.also.contain.periods].[our match] i now want to match the string "our match" (i.e. without the brackets), so i played around with lookarounds and whatnot. i now get the correct match, but i don't think this is a clean solution. (?<=\.?\[) starts with '[' or '.[' ([^\[]*) ...

GetInterfaces() returns generic interface type with FullName = null

Can anyone explain to me why GetInterfaces() in the below code returns an interface type that has FullName = null? public class Program { static void Main(string[] args) { Type[] interfaces = typeof (Data<>).GetInterfaces(); foreach (Type @interface in interfaces) { Console.WriteLine("Name='{0...

Is there any Radio grop button in .net winforms?

There is option called checkedListBox1 for check box group item.. Like that any control for radio button. and how to bind my data(data set) in that. ...

Slim .net: How do I debug test fixtures using visual studio?

I've figured out how to run my tests from the commandline using: java -jar fitnesse.jar -c MyFixturePage?test&format=text -d "c:/utils/fitnesse/" -r "FitNesseRoot" Using this as the startup parameters for my Fixture assembly project in visual studio does not work. I'm using the Slim runner and executor in my fixtures : http://github.c...

How can i use select to string in linq?

How cani use below codes string id = ( from in .....) how? using (StockProcedureDataContext stock = new StockProcedureDataContext()) { id = (from m in stock.StockTools from ss in stock.RefStockStatus where (m.statusid == 3 || m.statusid == 5) How can i do above...

How to send function keypress (F1..F12) to a console app in .NET

Hello everybody! I am writing a windowed .NET app in C#, which runs a third party console application via the Process class, as hidden as possible (CreateNoWindow, RedirectStandardOutput, etc.). I've redirected it's StandardInput, so I can write whatever string I want, but not function keys or other type of special keys, as they don't ...

.NET - Add Icon - Fixed Tool Window

I am working on .NET 2.0 with C#. I am using Form Border Style as "FixedToolWindow". I am not able to add icon with this property. Is it possible to add icon with this property? If so, give me a solution. ...

How to use indexers with Extension Methods having out parameter and function calls

Is it possible to use indexers with extension methods. eg. Consider it as an example only. public static object SelectedValue(this DataGridView dgv, string ColumnName) { return dgv.SelectedRows[0].Cells[ColumnName].Value; } EDIT usage mygrid.SelectedValue("mycol") How to use it as an indexer mygrid....