.net

Resize combobox arrow

I'm writing a touch screen .net winforms application and need a combobox with a larger dropdown arrow. Is there any way to resize the arrow, or am I looking at writing a custom control? ...

Localizing system generated status messages

Hello, I am working in a .NET environment where the system occasionally generates log entries for a customer. Messages are then appended to a customer log which can be reviewed at a later time. For example, if a customer is subscribing to a new service, or a customer has a failed payment attempt, these messages gets appended to the cus...

How to set values in a multidimensional array using a linear index

Hi, What is the most efficient way of setting values in C# multi-dimensional arrays using a linear index? For example given an array... int[,,] arr2 = { {{0,1,2}, {3,4,5}, {6,7,8}} , {{9,10,11}, {12,13,14}, {15,16,17}} , {{18,19,20}, {21,22,23}, {24,25,26}} }; How do I set all the elements to 30 using a ...

How can I add attributes to methods and types defined in IronPython?

Since IronPython doesn't support attributes I am wondering if there is another way to decorate IronPython classes with attributes, perhaps with reflection? ...

Is it OK to use Pulse & Wait? Or it is evil and a cause of write-only code?

Monitor.Pulse/All and Monitor.Wait are useful methods, but I'm getting complaints that when using them in large quantities (I have a DSL designer that spits them out by the dozen), the resulting code becomes unreadable. What do you think? ...

Finding a parsing API for partially utf8 encoded URL's

When parsing HTML for certain web pages (most notably, any windows live page) I encounter a lot of URL’s in the following format. http\x3a\x2f\x2fjs.wlxrs.com\x2fjt6xQREgnzkhGufPqwcJjg\x2fempty.htm These appear to be partially UTF8 escaped strings (\x2f = /, \x3a=:, etc …). Is there a .Net API that can be used to transform these strin...

Run a .NET program from a mapped drive or shared folder

I have written a C# Windows Forms application to merge the files and folders from a remote folder on one machine ("source" folder is a mapped drive - "Z:\folder") with another remote folder on a different machine ("destination" folder is a UNC path to a shared folder - "\\computername\sharedfolder"). I have Full permissions to both folde...

How do I convert from axd to ashx?

I'm trying to deploy elmah. For inexplicable reasons, I'm getting an error: .axd files are explicitly forbidden. I've already fixed what I can control (my web.config) and solutions requiring collaboration from the system admin are not available (such as editing machine web.config or updating IIS mappings). I also verified that it works...

How do I set a connection string config programatically in .net?

I'd like to set a connection string programmatically, with absolutely no change to any config files / registry keys. I have this piece of code, but unfortunately it throws an exception with "the configuration is read only". ConfigurationManager.ConnectionStrings.Clear(); string connectionString = "Server=myserver;Port=8080;Database=my_...

Can I skip MIME-parsing to get an attachment??

Hi - I am new here so first of all my greetings to you I am writing an application to run on my Windows Mobile (Pocket PC). FYI, I am using VB.NET. My idea is to use my e-mail account with my provider, who gives me a lot GB:s to use, as a virtual online storage disk. In a few words, more or less like the GMAIL-drive which you may have ...

Get the response headers from a WebService call?

Is there a way to get the responde headers from a web service call on .net? ...

How to obtain a copy from a gridview?

Hi Folks, Im trying to get a completly data copy from a gridview, itryed clone(), tryed cast DataView from DataSouce, but always get nulls or cant get the data, please exists a way to copy data from gridview, modified it and then reload it? or modifyng directly some rows in the gridview? thanks in advance! ...

ADO.NET Data Services

I'm looking at using ADO.NET Data Services with silverlight. I've been looking at the Data Model and Data Service Implementations (ADO.NET Data Services/Silverlight) topic on msdn. In their example, they build a data model generated from a database, and query entities in the datamodel. In my case I want to use stored procedures, so I...

Schedule Task with spaces in the path

We are scheduling a task programatically. However, the executable to be scheduled could be installed in a path that has spaces. ie c:\program Files\folder\folder\folder program\program.exe When we provide this path as a parameter to the Tasjk Scheduler it fails to start because it cannot find the executable. It obviously needs to be enc...

Read/Write/Modify XML

Hi, I have a XML File like that <?xml version="1.0" encoding="utf-8" ?> <Configurations> <EmailConfiguration> <userName>xxxx</userName> <password>xxx</password> <displayName>xxxxx</displayName> <hostAddress>xxxx</hostAddress> <sslEnable>xx...

Getting the location of a .tt file in T4.

Using T4 I want to generate some code based on examining what files are in a directory relative to the template file being executed. Is there a way in c# to identify what the path of the current template file is? ...

Enforcing Input Parameters to a Method without a bunch of if's at the beginning of the method?

I wonder if there is a less verbose way to do Input Verification in my methods. For example, i commonly write stuff like this: public string SomeFunction(string param1, int param2) { if(string.IsNullOrEmpty(param1)){ throw new ArgumentException("bla", "param1"); } if(param2 < 0 || param2 > 100 || param2 == 53) { ...

SOAP Service: Many Servers, One Interface

I have a scenario in which I'm going to need an arbitrary number of servers to provide the same SOAP web service. I would like to generate one set of proxy classes and be able to supply them with a location to point them at the different servers at runtime. Unfortunately, it looks as though the wsdl:port node (child of wsdl:service) requ...

Call function in User Control from code behind of the page

Now this is all way simplified, but here goes: I have a User Control that consists only of a single *.ascx file. The control has no code-behind: it's just a script with a few functions, like this: <%@ Control Language="VB" EnableViewState="False" ClassName="MyControlType" %> <script runat="server"> Public Function MyFunction() As ...

Make a WPF Window behave like a Context Menu (show/hide it properly)

I want to make a WPF Window that behaves like a context menu. So, for instance - when I show the wpf window, I want it to be the topmost window and from there on out, if the user clicks anything outside of that window I want the window to be hidden again. So far I have tried quite a few techniques but the only one that I found that kin...