|
There's no way beyond obfuscation. Frameworks that use intermediate code like .NET and Java all suffer from that, but that's part of what makes them highly portable. If you don't want your application to be easily reverse-engineered, then choose a language that compiles down to native code like C/C++.
Also, for every obfuscator, there's a deobfuscator. If you still want to keep your code managed, then consider a mixed-mode Managed C++ (MC++) assembly whereby sensitive code is written using unmanaged C/C++ and classes are exposed using the managed extensions so that they can easily be used by any other languages targeting the CLR, i.e. C#, VB.NET, and many others.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thank you for answer me.
If I use MC++, how can I write a class with unmanaged code, (with the result of native-code), 'cause I want the UI code managed, but many classes that I wrote have code that I want to protect so it should be native-code and all this building in one EXE. It could be that possible?.
Thank you.
J Herrera
|
|
|
|
|
As I said, you create a mixed-mode assembly that includes both unmanaged code and managed code, then turn compilation to the CLR on (/clr switch on the compiler, also available somewhere in the project configuration). See Managed Extensions for C++ Programming[^] in the Visual Studio .NET documentation for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am working on the ID3 algorithm send by Roosevelt and it is very useful but I have some questions and I need a fast answer to them
1) If I have a file containing the attributes can I read it from there and how?
2) How can I maiplate the output to show me each node with it value?
Thanks
Cherif
|
|
|
|
|
You can use a FileStream and seek to the last 128 bytes for ID3v1, or search the stream until you find "TAG" for ID3v2 and higher, IIRC. Just see the specs for ID3 for more information.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I think he was mentioning the ID3 data mining algorithm...
I see dumb people
|
|
|
|
|
I want to know how to make the target node of the minig algorithm accepts strings
|
|
|
|
|
I don't quite understand what is ID3v1 or ID3v2. I have a text file containing the attributes of each node and I want to read this file and put it in the attribute array. the problem is that each attribute must be givin a name and I don't know exactly how many attributes I have before reading he file so I need to create new attributes on the fly. It is like having a loop that crates new attributes.
i will be gratefull if you include a code or algorithm to this part because I've been working in it for 1 week and still no result (you can refer to the Roosevelt code to see what I mean)
Thanks
Cherif
|
|
|
|
|
I'm not sure I understand your original problem, since I thought you were asking about how to read ID3 tags from supported file types like MP3s.
If all you need to do is create arrays of information, either use an ArrayList (which internally re-dimensions arrays when they grow beyond the Capacity ), or use a Hashtable for a dictionary-based (i.e., name/value pairs) "collection" so you can refer to things by name.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Could someone please point me to some info on the how to make my app open a file when it is double clicked in explorer.
Thank you,
Sam
|
|
|
|
|
Then why is your subject entitled "Open with..."? This is what happens when you DON'T have an association.
File associations are easy. See Creating a File Association[^] in the Platform SDK.
This can easily be incorporated into an installer, too. See previous posts in this forum (click "Search comments") for information about how to do this correctly with a Windows Installer package.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanks...I needed that too
|
|
|
|
|
Sweet, that shows how to link an extension to the application, set the icon for the extension, and extend the shell, but...
How do I handle the link in my app? Do I need to test for a registry entry, is the program called with arguments, do I override function? I can't find anything on this subject.
Thanks again for the help.
-Sam
//you know you've been coding for too long when you hit Ctrl-Shift-B instead of submit
|
|
|
|
|
When you double-click on the file, Windows Explorer executes your application and passes the path to the file as the first argument. So lets say you have a FilePath property on your main application form, and/or a constructor which takes the path of the file. You could do something like this:
public class MainForm : Form
{
static void Main(string[] args)
{
MainForm form = null;
if (args.Length > 0)
form = new MainForm(args[0]);
else
form = new MainForm();
Application.Run(form);
}
public MainForm() : this(null)
{
}
public MainForm(string filePath)
{
this.filePath = filePath;
}
private string filePath;
public string FilePath
{
get { return this.filePath; }
set { this.filePath = value; }
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Exactly what I was looking for, thanks
|
|
|
|
|
the sample says:
Bitmap bmp = new Bitmap();
my questions is : can i create a bmp instance with 256 color depth ?
can i use the system 256 color table ( if it exists )directly ?
i do not want to get a 24 bits bmp and then transfer it into 256 color one.
i want to get a 256 color bmp directly. but HOW ?
and How to display the 256 color bmp after its creation ?
|
|
|
|
|
I think you have to set Image.PixelFormat property, but I'm not sure. One of Bitmap enumeration get this parameter.
fu0 wrote:
How to display the 256 color bmp after its creation ?
What do you mean by display?
Mazy
"I think that only daring speculation can lead us further and not accumulation of facts." - Albert Einstein
|
|
|
|
|
my meaning is How to draw this 256 color bitmap on a form.
can i use this codes?
Graphics c = this.CreateGraphics();
c.DrawImage(256bmp,xCoordinary,yCoordinary);
can the Graphic instance draw the 256 color bitmap use the code above ?
|
|
|
|
|
Instantiate your Bitmap using the Bitmap(int, int, PixelFormat) overload like so:
Bitmap bmp = new Bitmap(32, 32, PixelFormat.Format8bppIndexed); To load a specific palette, you'll need to load it from serialized data. One easy way would be to create a 256-color bitmap in mspaint.exe or something then save it. Open that with a simple program to get the Image.Palette and serialize that to some form you can work with (runtime serialization would probably work). Just deserialize that into a ColorPalette and set that as your Bitmap.Palette (inheritted from the Image ) class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have a custom dll in C++ which exports a class with certain member functions. I want to call the methods from a c# application. I am able to call the member functions seperately using the DllImports[....]. Is it possible to instantiate an object of the exported class from the C# tester application? Kindly help. Is there any link which would give me this detail.
Is the source code of the DLL necessary for this.
Thanks,
Regards,
Vini
|
|
|
|
|
If it where me, I would create a wrapper in Managed C++, then call that from c#. That way you could totally avoid DllImports. DllImports is fine and dandy for most functions, especially win32, but once you hit a function with some off the wall data structure it turns into a pain real quick.
-Sam
|
|
|
|
|
|
now, i have a problem in programed a network application. Have anyone can help me? The problem is that I need to open a powerpoint file in my program and send it to everyone in my network. Someone talk me that you can't embedded a powerpoint file in your program. Is it right? So, I think it may have another way like open an powerpoint than share the powerpoint to everyone in my network. But I don't how to share an application in C#. Please tell me. Thanks a lot...
|
|
|
|
|
|
PowerPoint is an application required to view PowerPoint presentations. Even if you embed it in a .NET application (written in C# or whatever other mangaged language), PowerPoint is still required to be installed on the client's machine. The installation source can be located on a network share, but it still needs to be installed on the client machine.
And, yes, actually you can embed the PowerPoint Viewer in a .NET application, but that too would need to be installed on the client's machine. This is how COM works (basically).
If you don't have PowerPoint available to all your clients on a network, you can download and install on each of their machines the PowerPoint 2003 Viewer[^], which can display PowerPoint slides from version '97 and newer (up till at least 2003).
Microsoft MVP, Visual C#
My Articles
|
|
|
|