|
Why would you wan't to write IL code inside C# code? It gets translatated to IL, so I really don't see a benefit from doing this ...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hand optimization is the only reason I can think of...
RageInTheMachine9532
|
|
|
|
|
Dave Kreskowiak wrote:
Hand optimization is the only reason I can think of...
Without proper knowledge of the JIT, you can never be sure if your hand-optimized IL will be actually faster than the "compiled" one. Probably will be, but you can't be 100% sure...
I see dumb people
|
|
|
|
|
Don't have to tell me that. Writing IL by hand isn't the easiest thing in world to do since you have to keep in mind that the instructions don't translate one for one with machine instructions.
But, the only way to find out is to try...
RageInTheMachine9532
|
|
|
|
|
CWIZO wrote:
Why would you wan't to write IL code inside C# code?
C# (and all other high-level languages) supports only a subset of CIL capabilities.
|
|
|
|
|
C# gets translated, but not in a efficient way.
I want to reduce all those load/store instructions that occur at function calls. In a long loop I see quite big benefit...
|
|
|
|
|
I found the easiest is just to use ILDASM and then patch it. You can write a method patcher alternatively. An extended PE format is used that is quite easy to read/write.
|
|
|
|
|
all works well on my laptop but when i copy the exe and config and DLL to another pc it seems sqlserver wont let me in the config file holds the username and password to connect to the database. I get this error invalid token ID
|
|
|
|
|
You might want to try updating the MDAC components on the other machine. Get that here[^].
RageInTheMachine9532
|
|
|
|
|
|
The language is not dictating this. Your use of the SQL driver is. If the other machine doesn't have the appropriate drivers updated to a minimum level, specifically the SQL Server driver, communication with the server will be problematic.
RageInTheMachine9532
|
|
|
|
|
a thousand thankyous i will give it a try and let you know
|
|
|
|
|
my mind has hit a flat spot how can i find out my version of mdac
|
|
|
|
|
There is no spot to go check for the MDAC version. But, you can go here[^] and pick up the Component Checker and it will ESTIMATE the version of MDAC your using. WARNING: This can take a while!
RageInTheMachine9532
|
|
|
|
|
you seem to know a fair bit, this is my first project as developer c# i use to be a trainer. i am building a windows app with and exe talking to a business dll to do all the processing so as i have a thin client i am not using remoting for the dll instead going down the route of a file share for the dll would like to know your thought if this is practical?
|
|
|
|
|
It's best to package the .DLL with the .EXE. If you keep the .DLL in a central location and, later, have to update the .DLL, you won't be able to because it is being kept open by however many copies of the software are running. You'll have an easier time updating application if it is installed completly local to the machine that is running it.
RageInTheMachine9532
|
|
|
|
|
I need to know how to invoke the execution of a OS command from a .NET (C#) application, more concretely the "net send" command.
A possible solution would be to create a batch file containing the command and a process to execute that file.
I would appreciate very much a more elegant solution from you!
--Miha
|
|
|
|
|
Try the following.
using System.Diagnostics;
string strCmdLine;
strCmdLine = "Net Send "+textBox1.Text + " " +textBox2.Text;
Process.Start("CMD.exe",strCmdLine);
process1.Close();
Help this works for you
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
Finally I implemented your solution, instead of using cmd.exe I used net.exe:
<br />
Process p = new Process();<br />
p.StartInfo.FileName = "net.exe";<br />
p.StartInfo.Arguments = " send " + strTo + " " + message + " ";<br />
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;<br />
Process.Start("net.exe",p.StartInfo.Arguments);<br />
p.Close();<br />
Thanks a lot!
--Miha
The truth will set you free!
|
|
|
|
|
I think you were after this:
using System;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace MyNetSend<br />
public class MyNetSend<br />
{<br />
[DllImport("NETAPI32.dll", ExactSpelling = true, CharSet=CharSet.Unicode)]<br />
public static extern Int32 NetMessageBufferSend (string serverName, string msgName, string fromName, string buf, Int32 bufLen);<br />
<br />
public SendNetSendMsg ()<br />
{<br />
string message = "this is a test message";<br />
string userId = "auser";
NetMessageBufferSend (null, userId, null, message, message.Length * 2);<br />
}<br />
}
|
|
|
|
|
can someone please tell me how to convert a numericupdown value into a byte
OR an int into a byte
|
|
|
|
|
|
That could easily throw an OverflowException if your integer value was greater than 254. To convert any numeric type, use BitConverter.GetBytes instead, which will return an array of bytes if you expect values greater than 254.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I hope i don't get slammed to hard for this question but i can't seem to figure it out.
I understand you can use ///<summary> ///</summary> to do your comment pages
I also understand you can comment code with /* */ and //
So, how exactly do you add it to your function. For example.
If you have OleDbDataAdapter1.Fill(dataset); you can put the mouse over the Fill and it will say what it does like Fills dataset or whatever.
I noticed all the microsoft functions have this.
I would like to include this into my class i'm making so I could easily assist the user in using my class. I don't even know whats it is called i would assume a tooltip.
Thanks for the help.
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
You can try this:
1. Enter a path for the .xml documentation file in the project's properties
2. Copy that .xml with the .dll
I'm not sure if it works, but the .xml documentation contains all the summaries...
|
|
|
|