.net

How to play .mp3 file from resources in C#?

I put music.mp3 in resources and then I added Windows Media Player to references. I wrote this code: WindowsMediaPlayer wmp = new WindowsMediaPlayer(); wmp.URL = "music.mp3"; wmp.controls.play(); It doesn't work. How can I play .mp3 file from resources? ...

How can I debug an oracle stored procedure from a .net web app?

I have a .net web application that makes heavy use of oracle stored procedures. One of these is problematic - some times it works, some times it doesn't. Is there any way to either attach a debugger to oracle when the sp is called, or step into it directly from Visual Studio? What other debugging techniques are there for a .net/Oracle...

How to set the same time on both computers connected over network in .NET?

Hi, I'm trying to be fair play in my network game and I would like to mark as winner the player who won first and it depends on time but DateTime.Now is local time and both computers may have set different times on their machines. Is there something that .NET provides for this case? Thanks! ...

Building .NET Application for Different Versions of Crystal Report in Visual Studio 2010

How Can i Build a .NET Application targeting different versions or probably the lower versions of the Crystal Report in Visual Studio . The Client Machine contains the Crystal Report 9 runtime as well as designer installed . Now is it run a .NET Application that uses Crystal Report Components in Visual Studio 2008 / 2010 that targets C...

Finalizers accessing managed stuff

I am well aware that finalizers are typically used to control unmanaged resources. Under what circumstances may a finalizer deal with managed ones? My understanding is that presence in the finalizer queue will prevent any object, or objects strongly referenced thereby, from being collected, but it will not (of course) protect them from...

IntPtr and avoiding unsafe code

I have an external library that takes an IntPtr. Is there any safe way to do this... int BytesWritten = 0; Output.WriteBytes(buffer, new IntPtr(&BytesWritten)); ...without having to use 'unsafe' code? I'm not that familiar with IntPtrs, but I'd like to do something like this: fixed int BytesWritten = 0; Output.WriteBytes(buffer, In...

TimeSpan and double rounding errors

Hello, I'm dealing with physical entities, such as time, speed and distance, and performing simple math, such as distance = time * speed, etc. Speed and Distance are double values rounded to 8th digit, and for Time values a .NET TimeSpan is used. Since TimeSpan rounds to a closest millisecond, I'm getting rounding errors, so I need to w...

Proportional Transformation

I have a form where user can add and position charts and controls for a presentation like app. User can then change it to FullScreen mode, How do I change the size and position of controls to keep a relative position and size? ...

Cross compile for .NET 4 and Silverlight 4 in VS2010 without duplicating files

We have a large number of projects within a solution mostly simple class libraries (which are later loaded through MEF) targetting .NET 4.0. We would like to compile a large number of these for both .NET 4.0 and the Silverlight runtime without duplicating files. Is there a way to create a new Silverlight class library and link the sour...

Help with English

I need to define an element from linkedList in a object:     A   /    \ X     Y How could I name the entire object and its components in English? à la: Hand-Body-Leg object named Body. or maybe somthing like queue kernel hand treeObject? Ok, let's show you the example of a railway: NodeStation => Station => Station => ...

Developing WPF App to Run on Windows XP Embedded Monitor

I'm experienced developing Windows client desktop apps with WPF, but I've never developed apps for a Windows XP embedded device. We have monitors located around the factory that run XP embedded and I would like to know if there are any issues developing a WPF application to run on the XP embedded monitor. For instance, what are some of...

.Net library for console menu driven app

I was wondering if anyone knew of a library for .net console apps that handled all the menuing functionality. I know its not that complex and I can just use Console.WriteLine("..."); to write text then do Console.ReadLine();, but am just curious if anyone knows of something existing that would handle the menuing. I'm likely to need sub...

reducing the command bars of objWinWordControl

Is it possible to reduce the CommandBars of winWord object? I've tried to see see the visible command bars on debugging. It gives casting error. Office.CommandBars bars = objWinWordControl.document.ActiveWindow.Application.CommandBars; foreach(Office.CommandBars item in bars) { System.Diagnostic...

How to specify log file path using folder locations in Windows with log4net xml configurator?

In my app.config I put <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="%programdata%/log-file.txt"/> but it didn't work. Any ideas? ...

Convert DSA asymmetric key in .NET XML format to PEM format

I have a DSA private key exported using the DSACryptoServiceProvider.ToXmlString, and I need to convert it to PEM format ("file.pem"), so I can open it in PHP using openssl_pkey_get_private function. How do I accomplish this? The solution can use DSACryptoServiceProvider.ExportCspBlob method if it's of any help, I just need to convert ...

How to make a vb.net see a vb 2005 class assembly

I am a java developer that inherited a vb.net web application. This app relies on a VB class assembly that builds in to a dll. I have made some changes to this class assembly but I cant seem to get the vb.net app to pick up the changes. I thought that using regsvr32.exe or regasm.exe would do the trick but after reading a bit more they d...

WebRequest and Resources - ASP.NET Timeout

I have a ASP.NET Web Forms application that internally makes many SOAP and REST calls to web services. The SOAP calls are made using Microsoft's own "wrapping" code. The REST calls are made from a simple REST client. This client uses Using blocks to dispose of any resources. The application runs fine for a few hours but then hangs up. T...

Capture a frame from a video (mpg, wmv, etc) at a specific time interval.

Is there a way I can capture a single frame from a video file (mpg, wmv, flv, etc) at a specific point in the video (e.g. 5 seconds or the 25th frame)? Then save it as an image? [Edit] Something link YouTube does. That can't be all done manually? ;) ...

Get Current Index for Removal in String Collection

I have a String Collection that is populated with ID's like so --> 12345 23456 34567 and so on. What I need to do is at the user's request, and when certain parameters are met, go through that list, starting at the top, and perform a method() using that ID. If successful I would remove it from the list and move on. I, embarrassingl...

How to enable "Caret Browsing" functionality in WebBrowser control in C# or VB.NET

Hi, I have IE 8 installed on my machine; and trying to integrate the "Caret Browsing" (navigation using Keyboard) concept into application which i am planning to develop. My sample application in VB.NET as follows: A Form - Form1 A Text box - TextBox1 A Button - Button1 A WebBrowser control - WebBrowser1 Added following line of cod...