Why does this work?
Why does this work? I'm not complaining, just want to know. void Test() { int a = 1; int b = 2; What<int>(a, b); // Why does this next line work? What(a, b); } void What<T>(T a, T b) { } ...
Why does this work? I'm not complaining, just want to know. void Test() { int a = 1; int b = 2; What<int>(a, b); // Why does this next line work? What(a, b); } void What<T>(T a, T b) { } ...
The msdn documentation says add namespaces imports to the CodeNamespace.Imports collection. This puts them inside the namespace (which makes sense, since your adding them to the namespace) namespace Foo { using Bar; //Code } However the rest of our code base has using statements outside the namespace: using Bar; namespace Foo {...
i am trying to add an website to iis 7 put when i try to run the website its gives the following error: HTTP Error 500.19 - Internal Server Error Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x80070021 Config Error This configuration section cannot be used at this path. This happens when ...
hi there i have a custom control that renders a number of literalcontrols in the createchildcontrols method. as below (there are other lines of literalcontrols being added that i have not uncluded here) this.Controls.Add(new LiteralControl(string.Format("<input type=\"text\" style=\"display:none\" value=\"{0}\" id=\"{1}\" name=\"{1}\" ...
I once read somewhere that apps should not copy data while doing an installation but rather all data creation must be done the first time the app is used. Q1: Does this apply to Windows Mobile apps also? Q2: Is it not okay then to copy a blank database to the \appdata\product\ folder and populate it when the user uses the app or must I...
Hi, Doing some automated FTP work, like this: Dim ftpLocation As New Uri("myFTPSite") Dim credentials As New System.Net.NetworkCredential("username", "password") Dim ftpRequest As System.Net.FtpWebRequest = System.Net.FtpWebRequest.Create(ftpLocation.ToString() & fileName) ftpRequest.Credentials = credentials ftpRe...
Hi All, I have application in .net 2.0 in which I have a DataTable object globally in my application and have different dataviews in whole application. When an action performed i have create many threads lets say 5 in which data is read from different dataview, meanwhile while 2/3 threads are reading data(not all 2 more left to read da...
I have some application settings that I'd like to add to my configuration file, but I'd like to group them outside of the normal "appSettings" section. My thought was that I would just create another "section" element within the "configSections" node of the config file, setting the "type" equal to "System.Configuration.AppSettingsSection...
On forms created with pre dotNET VB and C++ (MFC), a checkbox control responded to the plus/minus key without custom programming. When focus was on the checbox control, pressing PLUS would check the box, no matter what the previous state (checked/unchecked), while pressing MINUS would uncheck it, no matter the previous state. C# winfor...
Handling events exposed on a .NET class via COM in VB6 My test .NET (class libary registered for interop in compiler settings) code: Imports System.Runtime.InteropServices <InterfaceType(ComInterfaceType.InterfaceIsIDispatch), ComVisible(True)> _ Public Interface MyEventInterface <DispId(1)> Event Exploded(ByVal Text As String) ...
We are migrating our web sites from Win2003/IIS6 to Win2008/IIS7. Our .NET code is in a WAP form with compiled binaries. I do dev work on a Win7/IIS7 box so had to learn early how to set up HTTP Handlers in this newer environment. What I have that has worked fine on my box is: <system.webServer> <handlers> <remo...
Hello, I'd like to know if there is a way to create and launch a Remote Desktop Session on a Windows Server programmatically. I'm trying to make an automatic tool to create Local Users and then launch the associate RDP session. I've already made LocalUser creation and adding them to Remote Desktop Users (using net.exe). But I'm struck ...
What's the best way to configure the maximum number of threads that can pull messages from an MSMQ queue, using a netMsmqBinding in WCF? For example, say I have an MSMQ service for which I only want to have 2 (or 10, or whatever number of) worker threads pulling messages off at a time. ...
Does Subsonic support .Net 4.0? ...
I am implementing my own ArrayList for school purposes, but to spice up things a bit I'm trying to use C# 4.0 Code Contracts. All was fine until I needed to add Contracts to the constructors. Should I add Contract.Ensures() in the empty parameter constructor? public ArrayList(int capacity) { Contract.Requires(capacity > 0);...
I would like to do the following: *OperatorType* o = *OperatorType*.GreaterThan; int i = 50; int increment = -1; int l = 0; for(i; i o l; i = i + increment) { //code } this concept can be kludged in javascript using an eval()... but this idea is to have a loop that can go forward or backward based on values set at runtime. is...
We have a 64bit C#/.Net3.0 application that runs on a 64bit Windows server. From time to time the app can use large amount of memory which is available. In some instances the application stops allocating additional memory and slows down significantly (500+ times slower).When I check the memory from the task manager the amount of the memo...
Is there a way to find out the current execution of the code to find out the infinite loop? I have the application running with the current source. I'm attached with the visual studio debugger. I just need to know where the code is currently at so that I can debug it further. ...
The code I'm working with has a class called Environment that is not in any namespace. Unfortunately if I am in a class that imports the System namespace, there is no way to refer to the custom class called Environment. I know this was an unfortunate choice and should be refactored, but is there any way I can explicitly refer to the co...
I need a regex pattern to match this format ABC12345678: it should start with ABC and should have preceding 8 numbers. ...