.net

How do you get the host address and port from a System.Net.EndPoint?

I'm using a TcpClient passed to me from a TcpListener, and for the life of me I can't figure out a simple way to get the address and port it's connected to. The best I have so far is _client.Client.RemoteEndPoint.ToString(); which returns a string in the form FFFF::FFFF:FFFF:FFF:FFFF%00:0000. I've managed to extract the address and port...

How to list all classes with a specific Atttribute within an assembly?

Please help me on how to list all classes with a specific Attribute within an assembly in C#? ...

Matlab and .net problem with character string function input

I have a MATLAB function that I've compiled into a .net library. The function is a simple one that takes a character array as an input and a numeric array as output: function insert = money(dateLimit) .. insert = [1 2]; The function works fine when no function arguments are specified (a default argument is provided inside the function)...

WCF Service in Azure with ClaimsIdentity over SSL

Hello , Created a WCF service as a WebRole using Azure and a client windows application which refers to this service. The Cloud Service is refered to a certificate which is created using the "Hands On Lab" given in windows identity foundation. The Web Service is hosted in IIS and it works perfect when executed. I've created a client wi...

Architecture choice about representation of collections in Business Objects

I have made certain choices in my architecture which I request the community to review and comment. I am breaking up the post in smaller sections to make it easier to understand the context and then suggest/comment. I am sorry that the post is long, but is required to explain the context. What am I building A typical business applicati...

How to set windows 7 like look of desktop application (c#.net)

my client is asking for windows 7 like look for my desktop application (developed in c#.net). please tell me how can i set such theame for my application so that i would look like windows 7... please tell me if any such a controls/theme available... (open source is prefered)... please help me out.. i am using .net framework 3.5... and i ...

how to set target to application exe during deployment

Hi All, I have a console application and I want to deploy/share it using some msi/setup.exe file. I have used Visual Studio Setup Project type. I have created a desktop shortcut in User's desktop folder. But I can not point this shortcut to the application .exe file, it only allow to add application folder. So what I want, once I insta...

How to send a business card to a mobile using C#?

Is there any way to send a business card to a mobile phone using C#? I have an application in j2me which requires some set of data corresponding to some contacts so I want to send the business card of that contact via my server Business Card is a type of special sms which contains the contact details of any person ...

How to handle error on other thread?

Hi, I'm trying to handle errors that have occurred on other threads the .NET CF program is like below: static void Main() { Thread t = new Thread(Start); t.Start(); ... } void Start() { ... Exception here } In my situation, putting try catch in the Start method is impossible. How can I handle it in the global code?...

NCommon - changes in 1.1

I updated my NCommon version to 1.1. It looks like there are breaking changes. What happened to: the Store container class? the NHRepository constructor that accepts an ISession? How should I modify my code to address these changes? ...

How do I programmatically set property of control in aspx file ?

This may be a very dumb question but I can't seem to get it working. I use at many places the following syntax for dynamically binding a property of a control in aspx file to the resource entry, e.g. <SomeFunnyControl Text="<%$ Resources : ResClass, ResEntry %>" /> I want to do a similar thing with a class containing some constants, s...

.Net: Which one has better performance: setting image property of one control in design time or in run time?

Which one has better performance? setting image property of one control in design-time or in run-time? ...

Fast find object by string property

Hello, colleagues. I've got task to fast find object by its string property. Object: class DicDomain { public virtual string Id{ get; set; } public virtual string Name { get; set; } } For storing my object I use List[T] dictionary where T is DicDomain for now . I've got 5-10 such lists, which contain about 500-20000 at e...

Unable to find static resource in runtime even while designer can see it

So i have this markup: WizardPageTpl.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Werp.MigrationHelper"> <Style TargetType="{x:Type UserControl}" x:Key="WizardPageControl" x:Name="WizardPageContro...

What is it in MVVM that makes it particularly appealing for managed WPF and Silverlight but not native C++?

What is it in WPF and Silverlight that makes MVVM suit them so well? What is it in C++, or what does C++ lack, that makes MVVM and C++ never be mentioned together? ...

NUnit not running Suite tests

I've created a test suite in NUnit that references several distinct unit test fixtures in various assemblies. I've pretty much used the example code from NUnit's docs: namespace NUnit.Tests { using System; using NUnit.Framework; using System.Collections; public class AllTests { [Suite] public static...

BinaryFormatter in C# a good way to read files?

I want to read a binary file which was created outside of my program. One obvious way in C# to read a binary file is to define class representing the file and then use a BinaryReader and read from the file via the Read* methods and assign the return values to the class properties. What I don't like with the approach is that I manually h...

CSV is actually .... Semicolon Separated Values ... (Excel export on AZERTY)

I'm a bit confused here. When I use Excel 2003 to export a sheet to CSV, it actually uses semicolons ... Col1;Col2;Col3 shfdh;dfhdsfhd;fdhsdfh dgsgsd;hdfhd;hdsfhdfsh Now when I read the csv using Microsoft drivers, it expects comma's and sees the list as one big column ??? I suspect Excel is exporting with semicolons because I have ...

How to write in an file in MSIL code

Hi all, I have a aspx webpage which uses an assembly mine (which mades a custom authentification). I would like to modify MSIL code (so just with ILDASM/ILASM tools) of my assembly in order to log something in a file. I have tried to add this at the end of the authentification method of my assembly : IL_0034: ldstr "C:\\path_to_...

Class member variables, methods and their state

How should class member variables be used in combination with class methods? Let's say I have a class 'C' with a member variable 'someData'. I call C.getData(), which does not return a value but instead puts data in C.someData. The class that instantiated 'C' first calls C.getData and then uses the data by accessing the member variab...