.net

Quick Question: How can I make sure the current directory is not changed because of OpenFileDialog?

say my application is installed in C:\programfiles\xyz\ I've some setting & other data files (*.dat files) in this directory too. My application uses OpenFileDialog to open an image. Problem is that when ever user browses to some directory (say MyPictures) for an image. The current working directory of the application becomes that dire...

What is the fastest way to Initialize a multi-dimensional array to non-default values in .NET?

How do I initialize a multi-dimensional array of a primitive type as fast as possible? I am stuck with using multi-dimensional arrays. My problem is performance. The following routine initializes a 100x100 array in approx. 500 ticks. Removing the int.MaxValue initialization results in approx. 180 ticks just for the looping. Approximatel...

Problem in displaying the movie file in silverlight

I am developing a portal for online theatre system. I will show the movie in online website daily in shows(like 6-10 PM Shows). I am using Silverlight to display the video in web application. I am holding my movie file in Windows Azure Blob. I am having a problem displaying the movie file. Consider if ay user login to web system @6 The...

How can i detect audio level of a stream or tcplistener or the audio card using C#

Is this possible using only C#? I want to be able to detect audio from: a stream, microphone or soundcard and begin recording if audio level is above a settable threshold. Thanks :-) ...

opening transaction validation in vb.net

Can anyone help me on how can I validate transaction example: transaction = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted) If there's still an opened transaction, then the code above will ignore.. How do I know if there was a transaction not yet committed before opening new transaction to avoid Nested Transaction? ...

Why is XML Deserilzation not throwing exceptions when it should.

Hi Here is some dummy xml and dummy xml schema I made. schema <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.domain.com" xmlns="http://www.domain.com" elementFormDefault="qualified"> <xs:element name="vehicles"> <xs:complexType> <xs:sequence> ...

Periodically iterating over a collection that's constantly changing

I have a collection of objects that's constantly changing, and I want to display some information about the contents every so often (my application is multi-threaded, and differently threads are constantly submitting requests to modify an object in the collection, so it's unpredictable). If I lock the collection, I can iterate over it a...

how to make use of Text Services Framework into .net application

hi i want to make use of Com intefaces into my .net application, but this is related to Text Services Framework and i reasearched on this and it was like it only supports COM servers can anyone help me on this can i use TSF intefaces into my .net application and if yes Please tell me how to do it plzzzzzz :) thanks ...

How do I design a torrent application?

I was curious as to the "correct" architecture of a torrent application; with WPF as the front end? ...

Does breaking chained Select()s in LINQ to objects hurt performance?

Take the following pseudo C# code: using System; using System.Data; using System.Linq; using System.Collections.Generic; public IEnumerable<IDataRecord> GetRecords(string sql) { // DB logic goes here } public IEnumerable<IEmployer> Employers() { string sql = "select EmployerID from employer"; var ids = GetRecords(sql).S...

How could I get to know the resources occupied by a .NET thread?

Hi guys! I am developing a multi-thread application and one of my threads is somehow blocked by something and thus it will occupy some resource such as a file forever. Is there a way to find out which thread is being blocked and more important what resouce is being held by that thread? At last and as usual, thanks for your patience and...

CA1034: Nested types should not be visible

Here's an explanation of the rule that that I am trying to understand. Here's the simplified code that the Code Analyzer was complaining about: Public Class CustomerSpeed Public Enum ProfitTypeEnum As Integer NotSpecified = 0 FlatAmount = 1 PercentOfProfit = 2 End Enum Private _ProfitTypeEnum As Pro...

.Net: Looking for an example to compare "Transaction Script" , "Table Module" and "Domain Model" in order to make business components in business layer?

Hi I'm studying "Transaction Script" , "Table Module" and "Domain Model" but it seems somehow complecated to me. Could you please give me an example which compares these three methods? Thank you ...

Call https Payment gateway webservice from Windows consuming WCF

I have developed a WCF service in .Net and its Consumed as a window service. This WCF has binded with net.TCP binding from a ASP.net Website. this Website hosted with SSL certificate. I have Called Authorize.net CIM webserice from this WCF with Httpsbinding. This throwing exception as "could not establish trust relationship for the SSL...

c# - what approach can I use to extend a group of classes that include implemented methods? (see description for more detail)

Hi, I want to create an extendible package I am writing that has Topology, Node & Relationship classes. The idea is these base classes would have the various methods in them necessary to base graph traversal methods etc. I would then like to be able to reuse this by extending the package. For example the base requirements might see ...

Unity 2 and Enterprise library configuration tool

Hi, Can someone show me how to use Enterprise library configuration tool with Unity2 Whatever I did, when I open the Enterprise library configuration tool, I could not have it working with a Unity config file. When I click on the menu to add a new block, there is no Unity configuration block What am I doing wrong? Thank you for your ...

Windows Phone 7, download xml over ssl with authentication

Hi, I'm trying to download a file from my provider. The url is protected with basic username and password, and everything is sent over ssl. So I try to do this: WebClient proxy = new WebClient(); proxy.DownloadStringCompleted += (o, dscea) => System.Diagnostics.Debugger.Break(); proxy.Credentials = new Network...

Can I expose only a portion of one .NET DLL's public classes via a different "API" DLL?

I am designing a WPF application that uses a DLL with maybe 40 public classes. I need these to be public for a variety of reasons including ease of data binding and obfuscation. I would like to allow other people to use only a portion of these classes as an API for my software. I thought I would create the main library (core.dll) and ...

Need an example about console application which user can interact console window

Hello everyone, I need write a console application like as hiren boot screen: User can input a arrow key or a number for choosing. When a menu item is selected, I will fill a background for the selected menu item. Please give me some guideline or example. Thanks. ...

Where should I set generatePublisherEvidence to false in an asp.net app?

To reduce the loading time this blog suggests we set generatePublisherEvidence to false in the app.config for executables. <configuration> <runtime> <generatePublisherEvidence enabled="false"/> </runtime> </configuration> Where do I set it for web apps? The blog suggests that this does not go to the web.config. Whe...