|
Please don't cross post.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You used a tool, probably .NET Reflector to look at a .NET DLL. This is exactly what it's good for. .NET Reflector won't work on native code .DLL's, like on just about everything in the System32 folder.
What you want is not possible with a .NET DLL, or any managed code assembly for that matter. You can obfuscate the code and make it more difficult to be reverse engineered, but you cannot stop anyone from eventually getting at that code.
|
|
|
|
|
This seems to be the recurring nasty surprise about .NET. This has to tie with 'how do I deploy without needing the framework' as the top question asked.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I know. I hate answering the same question over and over again. Maybe we should put together a FAQ and post a link to it in everyone signature. "The top 10 questions asked on CP"
|
|
|
|
|
I'm bored to tears up here! I got called back into work (an hour drive) after being home for an hour and a half. Problem with IP tunnels in the WAN. I've been on hold with our "Lack of" Help Desk for just over 2 hours now waiting for them to figure out what they need to do to fix the problem.
So, what was for lunch?
|
|
|
|
|
I would like to know what happens when
you write unmanaged code in NET. The compiler
generates Intermediate Language code, but just
this code isn't "supervised" by the framework?
Also, I would like to know what happens when
you write assembly code in a .NET project. I
noticed that the __asm keyword is "syntax-hilighted".
Can machine code and Intermediate Language code exist
in the same .exe file ???
I am asking all these because, despite the fact that
I like the new capabilities the NET framework provides,
I am seriously concerned about the speed of my apps.
Thanks.
kostas KEL
|
|
|
|
|
|
1) All .NET code is converted to CLR compliant Intermiediate language code. This code is readable if you open .NET exe files in some of the native .NET debugging/.NET servicing applications. Most programmers who want to keep their code fairly safe use Obfuscators (hopefully that is spelled correctly). These applications make it harder for hackers to get the source code for the program.
2) It depends on your perspective with regards to program security with .NET compilations over native compilation.
3)One project can only have one language type files in the project. VC# applications can only have .cs files in the project, you will not be able to put VB or VJ# codefiles in the C# application. You can however have multiple assemblies or projects in the same solution that are of different languages. All compiled .NET assemblies can be used as references to VS projects of any .NET language.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi,
I have been asked to take a seminar of 30 minutes on advantages of Microsoft .NET framework 2.0. Our company is currently using framework 1.1, so they want me to tell them in my seminar whats the advantage of moving to Framework 2.0.
I have to take this seminar on this friday (18 - May), can someone provide me some resources or more information on this. I dont have access to google here, but have access to code project, msdn and some .NET related web sites.
Regards,
Blumen
|
|
|
|
|
It will be better for u to access MSDN & be prepared for that event.It consist of all the features that framework 2.0 is providing along with comparison to framework 1.1.u can also have the option to get knowledge of Framework 3.0 for Cross Question.
Bye
Ashwani Kumar
|
|
|
|
|
|
I am writing a command line utility in C#. When I try to run the program from a different directory with a batch file or if I put the program folder in the Path statement I get a file not found error on the App.config file. How do I build a command line program that can be called from outside it's build or installed location?
Jay Bowman
Springfield, IL
|
|
|
|
|
Hi all,
I came across a funny and I hoped you could help, I was profiling the performance of different operations in .NET and I found that double operation was faster in debug mode, than in release mode. I created a small project to test this premise it can downloaded here.
double i, j, dTest = 0;
DateTime tmrStart;
TimeSpan spanCost;
tmrStart = System.DateTime.Now;
for(i = 0; i < 100000; i++)
{
for(j = 0; j < 100000; j++)
{
dTest += i+j;
}
}
spanCost = System.DateTime.Now - tmrStart;
Console.WriteLine("Test took {0} milliseconds", spanCost.TotalMilliseconds);
The project code is the same as above code snippet. All my optimizations are set to the project defaults. Surely this can't be right ??? I have tested this on two boxes; my laptop and a performance machines with multiple processors and acres of ram, and I getting comparable results on both. So what am I doing wrong ?
C:\Documents and Settings\Administrator\Desktop\DoubleTrouble\DoubleTrouble\bin>
debug\doubletrouble.exe
Test took 82218.75 milliseconds
C:\Documents and Settings\Administrator\Desktop\DoubleTrouble\DoubleTrouble\bin>
release\doubletrouble.exe
Test took 311218.75 milliseconds
C:\Documents and Settings\Administrator\Desktop\DoubleTrouble\DoubleTrouble\bin>
|
|
|
|
|
Confirmed. Weird!
I looked at the IL between the two version. Ther'yre not that much different at all. Both are doing just about the exact same thing, with the Debug version peppered with NOP instructions and a couple of extra blocks like this:
ldc.r8 10000.
stloc.s VB$CG$t_double$S0
ldloc.s VB$CG$t_double$S0
ble.s IL_001b
The Release version doesn't have the to stloc.s and ldloc.s instructions, but it otherwise identical.
If you were to read through the IL only, you'd say that the Debug version must run slower! Hmmm....
|
|
|
|
|
I examined the IL earlier and thought they where more or less identical.
Will have another look, thanks for the confirmation. I am not sure where this leaves me though.
|
|
|
|
|
Sorry but all looks fine to me. I ran three consecutive tests
Release: Test took 36026.0145 milliseconds
Debug: Test took 91831.0365 milliseconds
Release: Test took 38050.299 milliseconds
Debug: Test took 92406.195 milliseconds
Release: Test took 36189.09 milliseconds
Debug: Test took 86926.077 milliseconds
Is it a 1.1 vs. 2.0 issue? Your projected needed to be converted when I opened it in VS2005.
-- modified at 14:30 Tuesday 15th May, 2007
only two letters away from being an asset
|
|
|
|
|
I got just the opposite using VB.NET 2005 and my own code.
Could be a JIT issue with a certain proc, maybe??
I've run it on a Pentium M 1.7GHz. Intel x86, Family 6, Model 9, Step 5.
|
|
|
|
|
VB.NET! Well that says it all
I tested on a AMD Athlon 64 X2 Dual Core 4800+ running Vista 64bit using C#.
only two letters away from being an asset
|
|
|
|
|
Hmm... OK. I've got a little time to try this in C# too. Hang on.
|
|
|
|
|
Well, not so fast. Rewriting the test in both languages, I got the same results as you. The Debug version is now SLOWER
The VB.NET version I used:
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Enable = False
Application.DoEvents()
Dim i, j, t As Double
Dim StartTime As DateTime = DateTime.Now
For i = 0 to 10000
For j = 0 to 10000
t += i + j
Next
Next
Dim EndTime As DateTime = DateTime.Now
Dim TotalTime As TimeSpan = EndTime - StartTime
Console.WriteLine("TotalTime: " & TotalTime.TotalMilliseconds)
Button1.Enabled = True
End Sub
The C# version is, line-for-line, identical to this, even the IL is the same.
using System;
using System.Collections.Generic;
using System.Windows.Forms;
blah, blah, blah
namespace Double_Performance_Test
{
public partial class Form1 : Form
{
public Form1()
{
InitalizeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
Application.DoEvents();
double i, j, t = 0.0;
DateTime StartTime = DateTime.Now;
for (i=0; i < 10000; i++)
for (j=0; j < 10000; j++)
t += i + j;
DateTime EndTime = DateTime.Now;
TimeSpan TotalTime = EndTime - StartTime;
Console.WriteLine("Total Time: " + TotalTime.TotalMilliseconds);
button1.Enabled = true;
}
}
}
Both get the same results:
Debug: avg of 3460 ms
Release: avg of 820 ms
-- modified at 16:48 Tuesday 15th May, 2007
|
|
|
|
|
Thats in .NET 2.0 though right ?
|
|
|
|
|
|
The mystery deepens
only two letters away from being an asset
|
|
|
|
|
Yes its a .NET 1.1 program ... Our flagship software is moving over to .NET 2.0 in September,
but I have trouble believing that this issue an issue in 1.1, must be something I am doing.
|
|
|
|
|
I am working on a project that communicates to an embedded microprocessor through a USB/UART chip. The processor is wired so that it can be reprogrammed through the UBS/UART also. My software is able to open the serial port and communicate with the microprocessor. I open the serial port with the following parameters: Baud 115200, Data Bits: 8, Stop Bits One, Parity: None, and Handshake: None. The problem occurs when the serial port opens: the DTR line goes low momentarily, which causes the microprocessor to reset. The software to reprogram the microprocessor forces the DTR low during the reprogramming process, so we can not just disconnect the DTR line. Basically, my question is this: is there anything in the SerialPort.Open() internals, or the internals of the WinSDK functions that the Open() uses that would explain this?
|
|
|
|