.net

How to determine length of the vorbis-header-blocks?

I'm trying to read a Vorbis-Stream and am doing it by the specification. At start, I've got the Identification, Comment and Setup-Header (starting with the bytes 01,03,05), but I don't know how to determine the length of the individual blocks. Anyone can help me with that ? I don't need to decode the stream itself. I just want the metad...

Embedding LuaInterface in C# has a poor performance?

I've embedded the LuaInterface project into an application written in C# using .NET Framework 4.0. After compiling LuaInterface and Lua 5.1 I've referenced them in my application and created a Lua VM and exposed a few .NET classes. When the Lua VM doesn't make many calls, performance is not affected at all; but when it starts to call a l...

Can I use DbgEng extension DLL in custom application?

Hi all, I am curious can I use DbgEng extension without WinDbg. For example is it possible to use DbgEng extension from managed .NET application? Regards, Remsy ...

Winforms ListView - Stop automatically checking when double clicking

How do I make a listview not automatically check an item when I double click it? I can try hooking into the MouseDoubleClick event, and set the Checked property to false, but that feels like a bit of an hack. I also run a reasonably expensive calculation when an item is actually checked, and don't want this code to run on a double click...

web.config issue in ASP.Net

Hello everyone, I am using VSTS 2010 + ASP.Net + C# 4.0 to learn someone else's code for a WCF application. I find besides Web.Config, there are also Web.Debug.config and Web.Release.config. I searched the content of Web.Config, but cannot find any reference to Web.Debug.config and Web.Release.config. However in VSTS 2010 IDE solution e...

NServiceBus message interception?

Is there any way to intercept messages in NServiceBus? From now i can do it manually via introducing base message handler like this: public abstract class MessageHandler<T> : IHandleMessages<T> where T : IMessage { public IBus Bus { get; set; } protected abstract void HandleCommand(T command); public void Handle(T com...

Customizing the default "The application failed to initialize properly (0x00000135)" message

Hi, When the .net framework cannot be found, the following message is displayed: "The application failed to initialize properly (0x00000135)" Is there a way to make it a tiny bit more specific (instead of writing a wrapper in another language), eg. by telling the user about the .Net fx? Thanks! CFP. ...

Ok to return a Viewmodel from repository?

Hello all, Been around here for a while but this is my first question @ so. Scenario: Mvc site. Viewmodels for most pages. Each viewmodel contains models or iqueryables acquired from different repositories. Each source is updated frequently (from outside the scoop of the site) so even if caching local it will be a lot of datasource h...

run native(unmanaged) exe from memory in C#

hello i have some c program that use from those in my c# program. i dont want send those c exe to client. that mean i dont want user can see those exe. i want to load those byte to memory and run its from memory. how i can do that. thanks a lot. ...

Simple C# code freezes itself and all 32-bit applications (incl. VS2008) but only if run under a debugger with a breakpoint set.

Background: As part of a small winforms app I'm developing I have a login screen. Besides the standard username/password fields it also has a third field - "Location" which is a dropdown containing possible geographical locations where a user can log on. The list of possible locations depends on the "distributor" to which the user belong...

How can I get sub IP of visitors in my website

I can get IP from visitors but how can I get sub IP in visitors networks ...

How to save a new record in SortableBindingList

I have a DataGridView connected to a SortableBindingList. db = new eScanEntities(); bs = new BindingSource(); List<Doctor> lDoctor = db.Doctor.OrderBy(o => o.DoctorNo).ToList(); bs.DataSource = new Classes.SortableBindingList<Doctor>(lDoctor); dataGridView1.DataSource = bs; I can edit a record i...

Obtaining global roots from .NET programs

I recently started using the ANTS profiling tools for production work. Aside from being amazed by their awesomeness, I couldn't help but wonder how they work. For example, one of the most useful features lets you visualize the global roots of a running program complete with the number of references to values of different types. How does...

check whether array contains false?

How to check the array true_or_false containing a value of false? bool[] true_or_false = new bool[10]; for (int i = 0; i < txtbox_and_message.Length; i++) { bool bStatus = true; if (txtbox_and_message[i] == "") { bStatus = false; } true_or_false[i] = bStatus; } ...

Define "dynamic" enum

I'm working on this project and I have a large number of "services" to execute. I need to have this service codes so I can verifiy and make decisions according to selected services by it's code. I'm tring to define this enum and get its values from the web.config so I can change them easily. public enum ServiceCodes { Transfer= Co...

What is the difference between the type String and type string? (Uppercase first letter)

Possible Duplicate: In C# what is the difference between String and string I couldn't find the info anywhere, but I'm sure it's just a simple answer. Are they interchangeable?? ...

Is it possible to use NBuilder to Build a collection of random strings?

Hi Folks, pretty simple question: can I use NBuilder to create a collection of x number of random strings? I was trying... // NOTE: Tags need to be lowercase. return Builder<string> .CreateListOfSize(10) .WhereAll() .Has(x => x = randomGenerator.Phrase(15)) .WhereTheFirst(1) .Has(x => x = "time") .AndTh...

Find Control by name from windows forms controls.

I have list of my textbox names. I want to find control by name. How it possible ? ...

What is a Page Directive in .NET

I'm studying up for a Microsoft Certification exam, and some of the wording for the 'content' in the examn confused me. In the MS exam website, under Developing Web Form Pages, it says in regard to the content on the exam... This objective may include but is not limited to: page directives such as ViewState, request validation, even...

In .NET, does a parent class' constructor call its child class' constructor first thing?

public class Parent { Child child1; public Parent() { child1.Name = "abc"; } ... } Gets a NullReferenceException. I thought the Parent() constructor calls the Child() constructor first, so that it is possible to access child1 object later in the Parent() constructor??? ...