.net

WCF via Windows Service - Authenticating Clients

I am a WCF / Security Newb. I have created a WCF service which is hosted via a windows service. The WCF service grabs data from a 3rd party data source that is secured via windows authentication. I need to either: Pass the client's privileges through the windows service, through the WCF service and into the 3rd party data source, or...

Trying to create C++/CLI assembly for use in .NET

I'm trying to bring a C++ library into C#, so naturally I am trying to make a C++/CLI project. In visual studio I created a new project (Visual C++ project, class library). I then tried to make a test class out of the pre-generated "Class1" namespace Test { public ref class TestIt { public: void DoWork() {...

How to design shape class

I want to design shape class. I need to distinguish several different shapes: -Point -Line -Triangle -Circle -Polygons The main purpose of this class is to calculate distance between two shapes. I've all methods for calculating those distances, but I want to have a single method that can be used, it should looks like this:...

Draw Bitmap with alpha channel

I have a Format32bppArgb backbuffer, where I draw some lines: var g = Graphics.FromImage(bitmap); g.Clear(Color.FromArgb(0)); var rnd = new Random(); for (int i = 0; i < 5000; i++) { int x1 = rnd.Next(ClientRectangle.Left, ClientRectangle.Right); int y1 = rnd.Next(ClientRectangle.Top, ClientRectangle.Bottom); int x2 = rnd.Ne...

Custom Data Types

Hello, quick question: I'd like to create some custom data types, but I don't think I'm asking the right question(s). There are "compound Boolean" values used throughout .NET, and I want to design some of my own. I've been using a series of Boolean variables, which works, but just isn't the same. Examples from .NET include: Color.Blac...

Visual studio use like VBA Editor

I want implement in my software solution an VBA editor but in c# 3.0. VBA edtior (vb 6.5) is obsolete. Microsoft have a solution for create macros and scripts editor for .net? if not how to implement a like solution? ...

Is SQL server the best DB for Storing and comparing images in database for a small ecommerce application.

I have been trying to create a small e-commerce web based application using MS Dot Net framework. The application will let the user allow to store the image of their product that they want to sell or purchase, then they will have the option to upload the image of a particular product and compare that image with the similar images in the ...

Which way is preferred when doing asynchronous WCF calls?

When invoking a WCF service asynchronous there seems to be two ways it can be done. 1. WcfClient _client = new WcfClient(); public void One() { _client.BegindoSearch("input", ResultOne, null); } private void ResultOne(IAsyncResult ar) { string data = _client.EnddoSearch(ar); } 2. public void Two() { WcfClient client...

Can't access CodeBase from a dynamically generated assembly.

I'm trying to create an assembly dynamically in .Net. I can't seem to figure out how to get the CodeBase property to return a value, however. Here's an example: var assemblyName = new AssemblyName { Name = "Whatever", CodeBase = Directory.GetCurrentDirecto...

.NET DB Query Without Allocations?

I have been given the task of re-writing some libraries written in C# so that there are no allocations once startup is completed. I just got to one project that does some DB queries over an OdbcConnection every 30 seconds. I've always just used .ExecuteReader() which creates an OdbcDataReader. Is there any pattern (like the SocketAsyn...

Are eCommerce platforms worth it for large scale systems?

My company and I are building a new system for a relatively large client. We are going to be replacing their entire system, which includes some eCommerce aspects to it among many other things. It is not a typical public shopping site, and there are many things about the system (both back end and front end) that are quite different. Some...

In .NET, Why Can I Access Private Members of a Class Instance within the Class?

While cleaning some code today written by someone else, I changed the access modifier from Public to Private on a class variable/member/field. I expected a long list of compiler errors that I use to "refactor/rework/review" the code that used this variable. Imagine my surprise when I didn't get any errors. After reviewing, it turns out ...

.net Listview control will only display largeIcon.

I'm using the RC of visual Studio 2010. Writing a .net 3.5 application. When I launch the app, the listview control only shows in LargeIcon view. This is not the view I want. I've set the View property in the designer with no success. I've even tried to explicitly set the view during runtime lvAvailableItems.View = View.Tile; Has anyo...

Is there any way for getting the direction of writing in specific culture?

Possible Duplicate: Is there any way to determine text direction from CultureInfo in asp.net? I want to get writing direction of any culture that user select in my application. for example I want to get rtl when my user use fa-IR culture and get ltr when en-US is selected. Is there a built-in solution for this in .NET? ...

Limit WebClient DownloadFile maximum file size

Hi everyone, In my asp .net project, my main page receives URL as a parameter I need to download internally and then process it. I know that I can use WebClient's DownloadFile method however I want to avoid malicious user from giving a url to a huge file, which will unnecessary traffic from my server. In order to avoid this, I'm looking...

how can I make a pdf file with flash files?

I have many .swf files and want to make a .pdf file with them, how can I do it automatically with a script file? Each .swf is only a slide and there are no animation in them! ...

WPF listbox select item on mouse over

I'm trying to make a style for a listbox which will set the selected item to an item when the item has the mouse on it. Any hints? ...

How can I find out what is stopping my object from disposing properly?

I have a rather large and complex game in C#, and in it are various monsters. The monsters are created in the game by a MonsterCreator, and each monster has various plugins that are loaded from external DLLs. When my monsters die, they call a method in the MonsterCreator, and the MonsterCreator removes them from the game map, removes th...

openxml option to be fully in text format ?

I have tried to generate "Hello World" with openxml sdk. To my surprise when trying to open the xml document it was not purely text format but it contains some ugly binary stuff. Is there any option to have text format when the content is only text ? I can't see any rationale for the binary part if it is supposedly "open". Update: my ...

Possible to run OData on a shared host in mixed auth mode?

My host has been pretty good about helping to tweak things to get my various .NET peices working, but they are unwilling to change the IIS authorization settings. Presently my OData service whines about that. Have I got any options? ...