But there is RegEx in general and then there is .NET's flavor of RegEx. Are you recommending the O'Reilly book for .NET?
flipdoubt
Posts
-
RegEx help for a RegEx Newb -
RegEx help for a RegEx NewbCan someone help me write a regular expression that will return a string from the beginning of the input string up until a certain string is reached? I know how to do this without regular expressions, but I want to use a regular expression so users can modify the format later. Also, can someone recommend a good tutorial for using regular expressions to accomplish this kind of task using .NET? Thanks.
-
Get Win32 file version?Thanks, guys! That is quick service.
-
Get Win32 file version?Is there an interop or P/Invoke (or are those the same?) call to ascertain the Win32 file version of a file? I want to list the version of all files in a directory, but some may not be .NET assemblies. How can I read this info? Thanks.
-
Access Vista indexing engine from .NET?Can I access the Vista indexing and search engine from a .NET application? If yes, can someone point me to resources on how to go about doing this? Thanks.
-
Simulate key strokes to trigger shortcutI want to trigger a behavior for which a third party component provides a keyboard shortcut. The user can trigger this behavior with CTRL+SHIFT+V, but I want to do it automatically in certain circumstances. Any ideas?
-
Best laptop for programmers?In your opinion, what is the best laptop for programmers? What attributes make a laptop better suited for programmers? Currently, I have a Thinkpad T40 and find it more than adequate. Getting a little old though, so I thought I would ask.
-
LZW compression using C#I know that I have the encoder installed on my machine because I can save single pages at G4 as well as multi-page tifs with the default compression, but I run into issues when I put the two together. My sample code reads a TIF file name from the app.config file, saves the first page in the file as a G4 image, saves the whole document as multipage file, but then fails when using the G4 EncoderParameter along with the save MultiFrame parameter. I'm using the same algorithm each time, just passing in addition EncoderParameters to the method. The astrices show the problem:
using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; namespace consoletest { /// /// Demonstrates my problem with multipage G4 tifs. /// class Class1 { /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { string testName = System.Configuration.ConfigurationSettings.AppSettings["testName"]; string compName = "compressed.tif"; string multiName = "multi.tif"; string multiG4 = "multiG4.tif"; System.Drawing.Image original = Bitmap.FromFile( testName ); try { Image[] pages = Class1.ToImageArray( original ); Class1.ToGroup4Compressed( pages[1], compName ); Class1.ToMultiPageImage( pages, multiName ); Class1.ToMultiPageImage( pages, multiG4, Class1.GetGroup4Parameter() ); } catch( Exception e ) { System.Diagnostics.Debug.WriteLine( e ); } } /// /// Turns a multi-page image into an array of single page images. /// /// /// public static Image[] ToImageArray( Image image ) { int count = image.GetFrameCount( System.Drawing.Imaging.FrameDimension.Page ); Image[] images = new Image[ count ]; if( count > 1 ) { for( int i = 0; i < count; i++ ) { image.SelectActiveFrame( System.Drawing.Imaging.FrameDimension.Page, i ); images[ i ] = image.Clone() as Image; } } r
-
LZW compression using C#Can I show you my code? It is just one console file.
-
LZW compression using C#Hi, guys. I have a slightly related question about compression. I've been banging out some code that uses the Imaging namespace's EncoderParameters to save an image as a multipage TIF. My problem is that the default compression schema appears to be LZW; or, at least, that is what some of my property readers are telling me. Anyway, I'm trying to save a multipage TIF with CCIT Group 4 Compression, but I get "invalid paramter" exception any time I try to add compression parameters. Heath, do you have any experience with saving multipage TIFs with CCIT Group 4 compression in GDI+? If not, do you know anyone who does? I can post my code, if you're interested.
-
Form flashes beneath an OpenFileDialog or 2nd FormThis happens more often with Debug builds than Release builds, but I often have a Form with lots of controls and, hence, lots of painting to do that launches another Form, whether it is an Open File Dialog or a new Form. Basically, the Form at the bottom of the z-order does some ugly flashing while the OpenFileDialog or new Form closes. I've tried SuspendLayout/ResumeLayout on the Form at the bottom but this doesn't seem to help with its constituent controls. Any ideas on how to stop this? I can show you screenshots if you think that would help.
-
Application Data Path for VB 6I'm a .NET programmer who knows how easy it is to access special folders via the Application.CommonAppDataPath and System.Environment.GetFolderPath() members, but how does one do this in VB 6?
-
What do you use the HACK task for?I use the HACK to denote "the following code is a hack to work around some unexpected behavior." Especially where using components, it often turns out that the HACK was neccessitated by a bug that the component vendor may correct or Microsoft might change in future versions of the Framework. What do you use the HACK task for?
-
Open Explorer to Network Neighborhood/Network PlacesIs there a canonical lookup table for class GUIDs for namespace extensions?
-
Open Explorer to Network Neighborhood/Network PlacesCool! Now the trick is to reliably look this up in different OSes.
-
Open Explorer to Network Neighborhood/Network PlacesI've read lots of stuff about opening Windows Explorer using command line arguments. Task http://www.createwindow.com/raewebsite/rae-2ex1.htm as an example. But how would I open Windows Explorer to Network Neighborhood or My Network Places? Any good ideas? I don't see an environment variable that might point me to such a place.
-
Can you use functions like sprintf in c#Why not just use String.Format?
-
God book on patterns in C#Not that great. Definately not a "God" book.
-
ObjectHandle and SerializationExceptionBy digging deeper into the sample code at ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dncscol/html/csharp05162002.htm, I found that the type they load dynamically descends from System.MarshalByRefObject. This makes sense to me, so I just made a loader that is a MarshalByRefObject which encapsulates all the dynamic loading of Tasks within itself. Now, I instantiate the Loader in the other AppDomain and have it do its diagnostics and return a list of assembly names that contain tasks to instantiate from the current domain.
-
ObjectHandle and SerializationExceptionThe following code throws a SerializableException where it unwraps the ObjectHandle, but why? I can't find it in any of the MSDN docs and it doesn't even go away when I mark the Task as Serializable? Here is the code: --- public ArrayList GetAssemblyNamesFromHandle( AppDomain domain, string[] assemblyNames ) { ArrayList names = new ArrayList(); foreach( string assembly in assemblyNames ) { System.IO.FileInfo file = new System.IO.FileInfo( assembly ); if( file.Exists ) { string name = assembly.Replace( file.Extension, String.Empty ); System.Runtime.Remoting.ObjectHandle oh = domain.CreateInstanceFrom( assembly, String.Format( "{0}.Task1", name ) ); // Exception thrown here. Task task = (Task) oh.Unwrap(); if( task.Succeeded ) names.Add( assembly ); } } return names; } --- Here is the Exception: --- An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll Additional information: The type TaskLib.Task1 in Assembly TaskLib, Version=1.0.1326.35718, Culture=neutral, PublicKeyToken=null is not marked as serializable. ---