Obfuscator tools wont really help you out much in this area. It might dissuade people who aren’t very driven to see how your code works, but for every obfuscator out there, there is a de-obfuscator that will unscramble the code. Besides, from my understanding, an obfuscator just scrambles the local variable names, to make it harder to follow the code. But the basic code; if, else, for, switch statements, as well as Function calls will still be very clear to read. I’ve looked at obfucatored code before using Anikrino and was still able to follow the algorithm used.
This is the problem with knowing a language/syntax and knowing a technology. All language compilers targeting the CLR compile to IL (so the source language really doesn't matter, sans some specific compiler optimizations), which is in many ways like assembler. The IL is JIT'd to native code and executed. Of course it can be disassembled.
But any good programs should fear very little. Copyright your work and make a good product that users want to buy, not buy because they don't really have any better choices. There are many programs out there written in .NET. Heck, Java is no different.
If you're using cryptography anywhere, it's always been said and written by leading cryptoanalysts that the best cryptographic libraries are open. Your algorithms should be so good that you don't need to depend on data-hiding.
Finally, if pieces of your application are really so important and you can't deal with the fact that some schmoe wants to copy pieces of it, make a native library and P/Invoke the functions (or, if using COM, create an RCW for your native COM object). This way, the majority of your application is still managed (which mainly gets that name from its memory management capabilities) and is faster to write and maintain.
DirectoryInfo di = new DirectoryInfo(
FileInfo fis = di.GetFiles("*.d");
if (fis != null)
foreach (FileInfo fi in fis)
This is the way I'm doing it now.
I'm actually getting the filename off a socket. So I create a dir and write a zero-length file using the file name then use the Directory.GetFiles() method. I just didn't know if there was a method that I could specify the file name and mask and get a boolean result, or something along those lines, so I don't have to write to disk. Thanks for your help as usual Heath.
You'll have to handle painting yourself since TabControl.BackColor always returns SystemColors.Control. You'll have to extend TabControl with your own class and override OnPaint to do so. There should be several articles here on CP ( I knew of a good one, but the bastard went commercial and pulled all his articles off CP after he got all our free help and beta testing! )
Why is this so hard? Because almost every control in System.Windows.Forms is just a wrapper for its Windows Common Controls equivalent where such details are often abstracted or don't fit the .NET pattern at all times. It is possible, though. I used a similar approach to override the painting for the actual TagPages in order to make them use the Theme API (for Visual Styles) correctly (they don't by default).
Note: this is only for the TabControl itself. To paint the TabPages, see the next message I posted (memory slipped!).
You can set the TabControl.DrawMode to TabDrawMode.OwnerDrawFixed and 1) handle the TabControl.DrawItem event if handling the painting from another control, or 2) override the TabControl.OnDrawItem if extending the TabControl with your own class (faster than handling the event inside a derivitive class).
Note: this is only for the TabPages. See the previous message about the TabControl itself.
I should warn you, however, that this is somewhat limited. You'd be better off using C++ and write one using COM or ATL (wrapper classes for COM). For documentation, search MSDN[^] for IDeskBand. You'll find LOTS of information.
Even if you use the first link I gave you, you should still read some of the information from the search results I mentioned directly above. It's important to understand how things work.
Morten Kristensen wrote: And I also have to say that I code in notepad/mono =)- Dont have VS.NET.
Good for you. I do a lot of coding in GViM, but what does that have to do with anything? You don't need VS.NET to code these solutions.
Morten Kristensen wrote: but there has to be some good ones in C# too.
There has to be? Someone has to be first. If you do a search on CP like I said, you'll find plenty of related articles about how to emulate a console window. The first link was how to actually embed the cmd.exe console window. If you can't find decent material in .NET, P/Invoke the functions required in the good C++ articles. Not everything is available in .NET, not even when Longhorn comes out (though a LOT more APIs will be available for managed applications).
There's been a recent multi-part article on document-centric applications on the Microsoft Developer Network (MSDN): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms09182003.asp[^]. As a developer, you should frequent not only CodeProject but MSDN as well - it contains a HUGE library of API and framework documentation, plus thousands of articles and tutorials on practically any Microsoft-related technology (and even some non-Microsoft technologies) you can think of.
Note: I gave you the link to part 1. See the table of contents (TOC) on the left of the page for other other 2 or 3 parts.
I have a regular window application project by C#. I like to embed this window application on the browser which is a ASP.NET application. I used to program ASPX page with ActiveX control component from 3rd party.
How do I convert C# based application to activeX control so I can run on the browser? Once I create dll files within .NET 2003 environment (C# compiler), can I program a activeX control by either C#, VB and/or C++ in .NET?
Or is it impossible to use .NET dll with VB6.0 in order to create activeX control?
You don't - you can embed .NET controls in Internet Explorer. You can make an CCW (COM-callable wrapper) for your .NET control, though, so that you can script it. I've been working on converting an older article from another site, but this should help you: User Controls for Windows and the Web[^]. There's also an article by Nick Parker that goes a little more in depth about how to create a CCW for your .NET control here: Creating a CCW for COM enabled non .NET applications[^].
Note that all this still uses the <object> tag, but with a different format for the classid parameter: it is a URL to the assembly, followed by a # sign, then the fully-qualified type name for the Type that you want to embed. There is more information in MSDN about this deployment method: Deploying a Runtime Application Using Internet Explorer[^].
Ray Gregory wrote: Would it be logical to create one as a derived Rich Text box?
No! The RichTextBox is not really a line-driven control and would be left parsing lines - perhaps even RTF for multi-line commands or commands with tabs - and it would not be worth it.
There is one article here on CP that I know about that actually embeds a console window in an Explorer bar: Command Prompt Explorer Bar[^]. This might give you some tips about embedding it in your application, but make sure you know how to P/Invoke native functions.
You should also search[^] the CodeProject site for "console". There are many pages worth of hits, and the link above only searching C#/.NET/VB.NET article topics. Add MFC/C++ in there if you feel comfortable P/Invoking native functions.
Using Windows Forms, this is pretty simple. You can either get this information in the KeyEventArgs, or using the Control.ModifierKeys static property.
Since you're not using Windows Forms, you'll have to P/Invoke the GetKeyState function. You can either use the System.Windows.Forms.Keys enum, or if you don't want the overhead of referencing the Windows Forms assembly for a console app, you can find the VK_XXX constant values in the winuser.h header file.