.net

.net remoting stops every 100 seconds

We have very strange problem, one of our applications is continually querying server by using .net remoting, and every 100 seconds the application stops querying for a short duration and then resumes the operation. The problem is on a client and not on the server because applications actually queries several servers in the same time and ...

Dotnetnuke development environment and deployment.

My company is redesigning our intranet site and decided to go with DotNetNuke as the solution to implement. Now for the past year I've been trying to drive changes here about keeping development, testing, and production environments separate. I also want all changes that are relevant to the site to go into SVN, this includes data that de...

Format a number with commas, but keep decimals

I'd like to group the digits in a double by thousands, but also output however number of decimals are actually in the number. I cannot figure out the format string. 1000 => 1,000 100000 => 100,000 123.456 => 123.456 100000.21 => 100,000.21 100200.123456 => 100,200.123456 Disclaimers (it's not as straightforward as you think): ...

System.Random keeps on returning the same value

I am using a System.Random object which is instantiated with a fixed seed all thoughout the application. I am calling the NextDouble method and after some time passed I am getting 0.0 as result. Is there any remedy to this, has anyone else encountered this ? EDIT: I have one seed for the whole run which is set to 1000 for convience sak...

Why isn't this LINQ to XML Query Working (Amazon S3)

Given this XML ... <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt; <Name>public.rpmware.com</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <IsTruncated>false</IsTruncated> <Contents> <Key>0.dir</Key> <LastModified>2008-06-25T16:09:49.000Z</LastModified> <ETag>"0ba2a466f9dfe225d7ae852...

How to check that asp:TextBox does not contain html tags.

I have a text box and need to validate that it is plain text does not contain html tags. What is the best way to do it in .net Bonus Question: How to do the same with javascript. ...

How to prevent people from copying my .NET software

I only sell a few licenses of my software and I am worried when I sell them to the same company that they will all just share the CD around the office. Is there a simple way to keep this from happening? I don't need it to be hacker proof, and I don't mind if it takes me sending them a license key for each time they buy a new version. ...

C# Create a hidden transaction

Hello, I am using C# and DSL Tools for VS2005. I need to create Transactions to change some data but i want them to be hidden from the user, that means, to not show in the UNDO list in VS2005. I tried by disabling the UndoManager store.UndoManager.UndoState = UndoState.Disabled; But by disabling it all existing previous actions in...

How do RESTful and SOAP Web Services differ in practice?

I am implementing web services for a PHP application and am trying to understand what both standard web services and RESTful web services have to offer. My intent is to write wrapper code to abstract away the web service details so that developers can just "instantiate remote objects" and use them. Here are my thoughts, perhaps some of ...

How do I control audio volume in .NET 3.5?

I want to create a volume slider for my application. I don't mind whether it controls master volume or program volume, but I don't want to use pinvoke if there's an alternative. I'm using C# with .NET 3.5. ...

MSBuild Conditional Compilation

I have a web service class that the rest of the framework depends on to grab its data, but the web service class needs to have different method attributes depending on what environment it's in. For instance... [SoapDocumentMethodAttribute("https://example",...)] public string Test() { //doSomething } See that "https://example"? Th...

How to get Printer Info in .NET?

In the standard PrintDialog there are four values associated with a selected printer: Status, Type, Where, and Comment. If I know a printer's name, how can I get these values in C# 2.0? ...

Cannot get .NET application to access AD groups across domains

I have a .NET application distributed through ClickOnce. Security within the application is implemented through the WindowsPrincipal.IsInRole(GroupName) method using a set of groups as resources. This structure works well for us for users within the same domain as the groups. Unfortunately we now have users that need to use the applicati...

Create an object knowing only the class name?

I have a set of classes, each one is a different strategy to do the same work. namespace BigCorp.SuperApp { public class BaseClass { } public class ClassA : BaseClass { } public class ClassB : BaseClass { } } The choice of which strategy to use is configurable. I want to configure only the class name 'ClassB' instead of t...

Is there a recommended, suggested, or conventional structure for .NET and/or ASP.NET projects?

I'm thinking about starting work on a fairly large scale .NET or ASP.NET project (I haven't decided yet, but it is likely that, eventually, it will be accessible from both a desktop application written in .NET as well as an ASP.NET web application). However, I'm not sure if there's a conventional way to structure the project. The projec...

Visual Studio Installer does not include satellite resource assembly

I have a VS2008 installer project which installs a .NET Windows Service. One of the service's dependencies is a .NET assembly which has localized resources in the form of a satellite assembly. The installer is not packaging or installing the satellite assembly for some reason and the service will consequently not start. Any ideas? ...

Open a file for shared writing

The following code is just a simplified example to demonstrate my problem: using System; using System.IO; using System.Diagnostics; using System.Threading; namespace ConsoleApplication5 { class Program { static string LogFile = @"C:\test.log"; static void Main(string[] args) { for (int i = 0...

Add Your Own Custom Namespace to the My Namespace in VB.Net

I know how to add methods to the MY namesapce, but what I'd like to do is create my own namespaces. For example. My.Nation.State.City.Restraunt or whatever. ...

DataGridview Column Resize Problem

I have a datagridview where the users can select which subset of columns to view. The problem I am having is that when I change the columns being displayed, the column widths are only being determined by the width of the Header Cells, not the data in it. I do have each column set to AutoSizeMode = AllCells. If a new row is added, the c...

Typed DataSet connection - required to have one in the .xsd file?

In the .xsd file for a typed DataSet in .NET, there's a <Connections> section that contains a list of any data connections I've used to set up the DataTables and TableAdapters. There are times when I'd prefer not to have those there. For instance, sometimes I prefer to pass in a connection string to a custom constructor and use that ra...