.net

Recommended .Net soft real-time

I'm interested in getting comprehensive information about soft (hard too) real-time application in .Net 3.5/4 Winforms mainly (WPF perhaps). Google results for the thing are quite poor - some quides on parallelism only ... the question is how could I for example write a real-time patient-health monitoring client for some medical applianc...

How does one raise an event viewer "Event" in .NET?

I want to raise an "event" that shows up in the system event viewer (eventvwr.exe) from .NET. Unfortunately, Google is just giving me lots of other stuff about "events" which aren't the sort of events I want to raise. What is the correct API call? Update Thanks for the answers so far. Interestingly, I have found that calls to "LogEven...

Guidance on Complete Application Development Practices

For the last five or more years I have been working mainly on ongoing, large projects. I now wish to expand my scope of work and I realise I have fallen behind in best practices for developing, deploying, and supporting, complete and discrete applications or components. I would appreciate some pointers to books, articles, and web sites...

WebBrowser control displays html text directly instead of browser view of html.

I'm using WebBrowser control in .NET app. I construct a html text, then set the controls property DocumentText to this html. It works fine on my computer. On some other computers it simply displays the source as a text. I think that it may be connected with some explorer properties but I don't really know why it is behaving like this. Ho...

How to use "this" properly to access the form controls?

Hello, In my case I have panels,but to make it clear I will use buttons in my example. I have 5(or more) buttons and I set an event,for example - OnMouseHover, to all of the five buttons.How do I get ,which one has the mouse hovered if all the events link to one method To capture the button where the mouse is hovered,I tried using "th...

Preventing a combo from dropping down

Is there an easy way of disabling the drop-down part of a combo box? I want to prevent the user from seeing the items in the drop-down part in some scenarios. EDIT Thanks to all who replied so quickly! I had already considered the option of placing a textbox or label in the same location as the combo box and then hiding the combo-box ...

How do I handle drag-and-drop in the designer?

I've created a control, DataGridViewContainer, that fakes partial-line scrolling in a DataGridView - basically it's a panel and a scrollbar and a few event handlers. I'd like to be able to use DataGridViewContainer at design time, dragging a DataGridView onto it to set its .DataGridView property to the dragged control. How do I handle ...

Showing a dynamic size list in XAML (readonly)

Hi, I want to show a list of "properties" in my application. A property is simply a name/value pair. The number of properties is dynamic. The best way to do this? The only thing I can come up with is creating a ListView with an ItemTemplate. But then the items are selectable, and that's not what I want. If I make the list read-only, it...

Siverlight Grid XAML script issue

Hello everyone, Here is my Siverlight Grid script, I want Media Element mediaPlayer to occupy left half of the whole Grid space, and want Media Element cameraPlayer to occupy right half of the whole Grid space. But my following code does not work quite well (I have set related Grid column/row value), two Media Elements play overlap. An...

Encoding file paths

Is there a built in method in .net for encoding file paths in the same way you would encode a url? For instance, if I have illegal characters in a file name, like "whatever:whatever" I would like it to encode the ":" so it's still there, just encoded so that the system will accept it. I'd like to do something like Path.Encode(fileName) ...

parallel port access in C# .net

How can i send and receive data though parallel port using C# .net? Also can u guys please explain how to use parallel port to receive data? ...

Select ListIndex instead of Object for selected entry in DataGridViewComboBoxCell

Hi, I have a DataGridViewComboBoxCell, whose DataSource is a List. When an item is selected from the list, I wish to store the index of the item, not the item itself, in order that I can switch DataSources and still display a relating list entry. e.g. I have a list of months (January-December). I want to select "April" and store "3" in ...

Capturing key presses for form but not for controls

I have a simple modal form which I'd like to close when Esc key pressed. It's simple doing this handling form_KeyDown event. The problem is the controls on the form. When the form first launched one of the buttons get focus and pressing Esc of course doesn't do anything. Disabling TabStop of every button prevents this but again Esc stops...

How can I add Windows DateTimePicker to a win32 Application in c++

I have a Win32 application and i want to Add a DateTimePicker Control, like the one in .NET. I though don't want to include the whole Framework in my application, nor MFC or whatever. How can I add the native control in a Way with the least amount of dependencies? ...

to insert text box control into an grid view

I want to insert a textbox control into a gridview,so that I can enter a value into the textbox at runtime? ...

guid to base64, for URL

Question: is there a better way to do that? VB.Net Function GuidToBase64(ByVal guid As Guid) As String Return Convert.ToBase64String(guid.ToByteArray).Replace("/", "-").Replace("+", "_").Replace("=", "") End Function Function Base64ToGuid(ByVal base64 As String) As Guid Dim guid As Guid base64 = base64.Replace("-", "/").Re...

How can I determine which company an IP address belongs to ?

I'm trying to programmaticaly determine the company* associated with a given IP address. My first guess was this : string hostname = Dns.GetHostEntry(IPAddress.Parse(ip)).HostName; but this won't work if the reverse DNS isn't set correctly, which seems to happen 90% of the time. However some websites are still able to successfully...

How do I know when a session has ended when sessionState != InProc

I would like to have the session state in a separate process for my app, but I would also like to have some code run whenever a user's session is over. (changing a status string that indicates whether they are online or not and decrementing the online users count.) If my session state is InProc in the web config, I can use the Session_...

iTextSharp Creating a Footer Page # of #

Hi, I'm trying to create a footer on each of the pages in a PDF document using iTextSharp in the format Page # of # following the tutorial on the iText pages and the book. Though I keep getting an exception on cb.SetFontAndSize(helv, 12); - object reference not set to an object. Can anyone see the issue? Code is below. Thanks, Rob pu...

What is the safest way to implement Web Services / API?

I have a web site with users and their data accordingly. What is the safest way to implement web services / API such that users' login credentials and in turn data are secure? oAuth isn't really an option, because usage will not necessarily be in other web apps. My concern is that having the username and password as an input is dangero...