Which Timer object should I use in long running processes in .Net?
Which Timer object should I use in long running processes in .Net? The timer will be used in a Windows Service, and I wish to find the best fit performance wise. ...
Which Timer object should I use in long running processes in .Net? The timer will be used in a Windows Service, and I wish to find the best fit performance wise. ...
Hi I am not sure what I am doing wrong. I am trying to use the asp.net regex.replace but it keeps replacing the wrong item. I have 2 replaces. The first one does what I want it to it replaces what I want. The next replace that is almost a mirror image does not replace what I want. So this is my sample code <%@ Page Title="Tour" Lang...
Lets say we have this code that runs in the constructor: Dim initVectorBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(initVector) Dim saltValueBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(saltValue) Dim passPharse As String = GenerateKeyString(EncryptionKey) Dim password As Rfc2898DeriveBytes = New Rfc2...
Sor far I have: <Grid x:Name="MainLibraryGrid"> <TabControl Name="TabControl1" TabStripPlacement="Bottom"> <TabItem Header="300s"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefini...
I'm trying to perform some basic AD User managment tasks in C# using .Net 3.5 I've got a System.DirectoryServices.AccountManagement.UserPrincipal object that contains the user details. I can call user.ExpirePasswordNow() and the user will be forced to changed their password at next login (and the "Active Directory Users and Computers" ...
I have a Dictionary<string, XMLMessage> where XMLMessage is a struct: private struct XMLMessage { public string Message { get; set; } public DateTime TimeRead { get; set; } } I will use the Dictionary similar to this: storedMessages["1X"] = new XMLMessage() { Message = "<XML>1X</XML>", TimeRead = DateTime....
In my server application (written in C#), I need to create a pool of same type of objects. I pull an object from pool when I need, and it goes back to pool when it is no longer needed. Mechanism needs to be thread safe since different threads will be asking and submitting these objects. I understand that frequently locking something to m...
Regex.Match has a .Success and .NextMatch why doesnt it have a GetEnumerator function? With my logic it seems easy enough to implement. But it isnt in 3.5 so can anyone tell me why not? foreach (var m in Regex.Match("dummy text", "mm")) error CS1579: foreach statement cannot operate on variables of type 'System.Text.RegularExpressions...
I have verified that after installing the .Net Framework 3.5 SP1, when the User Agent string exceeds a certain number of characters, the user agent is defaulted to 'userAgent string:Mozilla/4.0 (compatible; MSIE 6.0)'. I've verified this behavior on several machines but can't seem to find a suitable workaround. This is preventing some Si...
Hi There, I have a asp.net web page with some contents and a BulletedList with some international characters, I am using iTextSharp library to export to PDF format. How can I export only this BulletedList with international characters to PDF. Any Ideas? Thanks ...
I want to start using XML-Documentation of my code and am desperately searching for an up-to-date (meaning .NET-3.5 SP1) to do so. I found NDoc, but it only supports .NET-1.1 and that a little bit far away ;-) Any suggestions? ...
I have the following XML that is built up at runtime using an XmlDocument: <?xml version="1.0" standalone="yes"?> <NewConfig xmlns="http://tempuri.org/NewConfig.xsd"> <SystemReference xmlns=""> <ID>1</ID> <Name>CountryName</Name> </SystemReference> <ClientList xmlns=""> <Type>Private</Type> <!-- elements omitte...
I'm building a small application and to reduce hosting costs and dependencies, I am planning to store all persistent data to xml files rather than a Sql Server database. In this case, the site audience is limited to friends and family - no more than a few concurrent users are ever expected, so the site does not need to scale. Is it fea...
I'm a C# novice running .NET 3.5, and I'd like to store a bunch of application default values in App.config, as the settings may vary by server environment (e.g. development, staging, production). What I want to do is similar to what's described in this StackOverflow article, but I also want to be able to use non-string values (e.g. int...
Hello, I am working on an Filter Attribute for ASP.Net MVC that will return a 304 response when the content has not been modified. It would be handy to be able to read the Last-Modified header value set in the Controller in order to accomplish this... there just seems to be one problem. I can't seem to find a way to read the headers when...
I need to run a bunch of pluggable processes in a windows service on my server and want to create a user interface that allows me to interact with each of the plugins in use by the service. What is the most common method (or methods) for communication between a user interface and a long-running windows service? I am thinking of providin...
Our company uses .NET 2.0 to develop server application which is installed at a number of large customers. We still use 2.0 only because it is installed on all customer servers by default. For us, as developers, this is sometimes total madness, especially for those who migrated from .NET 3.5. We can't use most powerful language and fram...
Is there a hook somewhere within Linq to SQL that would allow me to manually modify a command before it is sent to the database? Specifically, I am trying to introduce the WITH CHANGE_TRACKING_CONTEXT(@contextData) syntax whenever an insert/update/delete is applied to the database in order to be able to add additional information agains...
If I use a FileStream to create a StreamReader, will the StreamReader close when I close the FileStream or will I need to close the StreamReader too? public void ReadFile() { var file = new FileStream("c:\file.txt", FileMode.Open, FileAccess.Read); var reader = new StreamReader(file); try { txtFile.Text = reader.Re...
I am returning to WPF after a year of winforms development and am trying to get my eye back in with a small project. I am creating a simple 'Filename Textbox' which is a usercontrol with a textbox and a button ("...") which spawns the FileOpenDialog. On this usercontrol I have declared a dependency property of Filename which the Textbox...