.net

How can I play a midi file with .NET compact framework 2.0?

I have tried this but it does not work (even if I specify .wav file as an input). Also tried this but still no sound. Trying to avoid .wav because they are BIG if you compare with midi. I'm trying this with VS 2008 emulator. Is that the problem? Should I test on the real hardware? What is the best way to play midi on the .NET compact ...

datacolumn format as currency in .NET

Can I format the type of a datacolumn of a dataset to currency (for a specific culture) before binding it to the grid ...

ASP.NET + C# Multi-Project Solution. Where should I put my global utility functions?

As the Title says, I've got a multi-project solution. I've got a "core" project that is loaded with most of the other projects. So my question is this, I have a few utility functions such as FormatPhoneNumber(..) that I would like to be able to access in the following manner from anywhere. (in Project_B which depends on Core) string ...

cacheRolesInCookie not caching roles

Hi all, I am trying to use forms authentication with the following configuration settings. I have set cacheRolesInCookie to true. However, I am finding that the RoleProvider's GetRolesForUser method is called on every request. I can see that the cookie .asproles is created and has data in it but it appears to be ignored. Has anyone come...

How to keep .dll files apart from .exe file that uses them?

Normally you have to put all the .dll files your application uses in the same location as the .exe file. I would like to keep the libraries in some other, dedicated folder and just show my app where to look for them (by some path in app.config or something like that). How do I do this? ...

How do I use the GDI+ blur effect on a .NET Bitmap?

I need to apply a blur to a System.Drawing.Bitmap. The classes in System.Drawing are supposed to be wrappers around GDI+, so I'd I use the GDI+ Blur effect. Is this possible, and if so, how? Edit: I don't want to know how to write my own Blur effect, I want to know how to use the built-in GDI+ one. ...

Adding web reference on client when using Net.TCP

Hi everyone... I am trying to using Net.TCP in my WCF Service, which is self hosted, when i try to add this service reference through web reference to my client, i am not able access the classes and methods of that service, can any have any idea to achieve this... How I can add web references in this case. My Service has one method (Get...

.designer.cs what is it for?

In my project when I create a webusercontrol or a webform it creates the code behind, but it also creates a .ascx.designer.cs file. What is this file for? Can I prevent it from being added when I create a new webform/webusercontrol? ...

Could ROWLEX be used as .DLL files in commercial projects (because of some non-LGPL components)?

As people asked in How can ROWLEX be licensed under L-GPL while it uses SemWeb which is GPL? there is no definition if ROWLEX could be used as a library freely in commercial projects. How free is to use it in such projects? Is it possible to contribute to this project and simultaneously use it freely in commercial sector? ...

Can I prevent the CLR from optimizing away debugging information?

I've written an abstract base class for unit tests that sets up just enough environment for our tests to run. The class exposes some of the runtime environment bits as properties whose types vary test by test (the property types are type arguments specified in the inheriting, concrete test class). This is all well and good, except a co-...

How to check if an assembly has changed

Hi there, is it possible to tell if an assembly has changed? I have a standard project that generates an assembly called MyAssembly.dll. In a separate project i read the assembly and generate a hash. When i generate a hash for the assembly it is different each time i recompile. I have set the assembly version to be static, are there a...

ThreadStart.BeginInvoke throws NotSupportedException on Compact framework

I'm working with threads on a compact framework project and have code that looks something like below. When I try to step into StartThreads(), a NotSupportedException is thrown. This seems a bit wierd, why is the exception thrown on the line calling StartThreads() and not inside, and what is it that's not supported on CF? I think its Thr...

Java equivalent to .Net's NotSupportedException

Is there (not NotImplementedException, not supported). ...

'System::String ^' to 'LPCWSTR'

Hey, I want to convert 'System::String ^' to 'LPCWSTR'. for FindFirstFile(LPCWSTR,WIN32_FIND_DATA); Please help. ...

How to use a PKCS#12 certificate file in a .NET WebRequest?

Hi all, I have been issued a PKCS#12 certificate to be used for accessing a simple xml-based web service. When I load the PKCS#12 file into Windows (Vista), I can access the service using my browser. Trying to access the service through an application, without loading the PKCS#12 into the OS Certificate collections , I have written the...

Unpaired value in UriTemplate works on one computer, but not another

In my web service I have to recieve HTTP request over a URI of the form /a?b: [OperationContract] [WebInvoke(UriTemplate = "http://hostname/.../a?b")] Stream MethodName(Stream stream); without the typical ?b=c. This works fine on my development computer, running Windows Vista and .NET 3.5 SP1 (and adding URLACLs). However when attemp...

Could not load file or assembly <My compiled dll>, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.

I know this has been asked before but the answer given was a temporary hack. We have had a site running on our live servers for some time now and we have just made some updates and deployed. Intitally the JIT runs and the site works. When the application pool is next refreshed we are receiving the following error from the webserver (I...

is there any webservice to call scan my webpage?

is there any webservice. i send web page resources to scan for vulnerability.(Trojen+spy+xss+sqlenjection etc.)Like that Scanner(source) Scanner(source) { CallService(source) } OR Scanner(webpagename) Scanner(string webpagename) { // webpagename: www.xyz.com CallService(webpagename) } ...

Idiom for using SqlDataReader as a resource

Following on from this question, I find myself writing the following code over and over again: SqlCommand command = new SqlCommand(); // Code to initialize command with what we want to do using (SqlConnection connection = openConnection()) { command.Connection = connection; using (SqlDataReader dataReader = thisCommand.ExecuteRe...

Copying file to a server that is not part of a domain

I have a wpf application (C#) that needs to copy a file to a server that is not part of a domain. FTP cannot be used. I looked into using LogonUser() within advapi32.dll but could impersonate the local user to the machine successfully. Are there any other options? ...