|
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...
|
|
|
|
|
the xml file must also have the same name as the dll + ".xml"
eg:
mydll.dll
mydll.dll.xml
//Roger
|
|
|
|
|
Those styles of comments get compiled to an XML file which, as the others replies stated, needs to get deployed with your assembly in the same directory. That's what provides IntelliSense with member documentation.
For more on recommended tags and how to use them, see Documentation Comments[^]. Also, in your project configuration (right-click on the project, and select Properties) set the Documentation property to an XML file which matches your assembly name, like MyAssembly.xml if your assembly was MyAssembly.dll). This automatically builds the documentation XML file in the target directory (bin\Debug or bin\Release, by default depending on your build configuration).
You can also use these files to generate class documentation that can be easily viewed by developers, even integrated with the Visual Studio Common Collection which you see in VS.NET. See the NDoc[^] project - something I've helped develop a little - for a good (even Microsoft uses it for some projects) documentation generator that can produce HTML Help 1 and 2 and several other formats.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have a database application i wrote to allow me to take notes on c# and enable me to look up the answers at a later time. If anyone is interested in this just shoot me an email and i'll happily send you the application. All i would ask in return is suggestions. In any event, in this application I use crystal reports to display my code snippets and so forth. This is where my question comes in. Once it generates the report for me it appears to be in read only which is perfectly fine however, is there a way to make it where i can copy and paste. This would be benificial to me instead of having to write the source code on line at a time. I know I could make a text box and overlay it so I basically select from the textbox and it appears to be from the report. To me that would be a crappy way of doing it. Any other ideas?
by the way if your interested in that program I mentioned send an email to
REMOVEME_bigt1@comcast.net
thats a one instead of a L
Win32newb
"Making windows programs worse than they already are"
|
|
|
|
|
Reports and read-only for a reason - there's nothing to change. If you're looking for design capabilities at runtime, you need to license (costs mucho $$$) the designer components from Crystal Reports.
Microsoft MVP, Visual C#
My Articles
|
|
|
|