|
Mmhmm, that's good to know from a performance standpoint. So what you're saying, I think, is that Web services aren't plain awful on performance from a threading perspective, which I'm prepared to believe. I'm mostly worried about making the application consume too much of the available network resources, and I also figure that the encoding/decoding overhead of a binary formatter is going to be less than that of XML serialization and deserialization.
I was thinking a while back about writing a lightweight Web services provider that could be used outside of IIS, just to provide an easy point of entry into things like Windows services. I wouldn't be able to easily (read as ever) provide all of the built-in security functionality of Microsoft's Web services implementation, but I could make it easy to cobble together communication between your components in a snap. I don't know, maybe I'm overafraid of this remoting stuff. It seems pretty similar to Java RMI, which wasn't all that complicated.
-Jeff
here, bloggy bloggy
|
|
|
|
|
It's okay to be afraid of Remoting at first, but once you get the hang of it it's great! There you can use a BinaryFormatter which does improve performance (even just serializing/deserializing, not to mention the bandwidth required).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I've created a custom button and placed it in the designer toolbox. When I make changes to the button dll and rebuild it, I can then place the new button, with all the new features, on my form. The problem is that none of the previously-created buttons have the new features. Is there a way to tell the designer to use the new dll instead of the old one?
|
|
|
|
|
The designer has little to do with it. All the code is serialized to your code file (your .cs source file) and an assembly reference is added to your project references. In real-world solutions, you common add multiple projects to a solution and use project references - not assembly references (right-click on project, select Add Reference, then click the Projects tab). This keeps the version numbers in sync, as well as the makes the build configurations the same.
As far as the toolbox goes, putting controls you're currently developing in there is a big mistake since they change often.
Also, if you're working on a multi-project solution, I highly recommend NOT using automatic versioning (i.e., using an asterisk - * - in the AssemblyVersionAttribute common found in AssemblyInfo.cs). This can get to be a big pain really fast, especially when not all your assemblies are bound to each other (like a plug-in type application).
If you're building UserControl derivatives in the same project in which you're working, the designer usually (it's supposed to) adds them to the toolbox for the active project automatically.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath,
Thanks for your reply.
The control dll and the application are separate projects in the same solution. I set the version of both assemblies to 1.0.5000.0 (no auto-increment). The dll is added to the application as a reference project, just as you suggest. But still the old buttons are not updated when I rebuild the dll - not even if I remove and re-add the reference.
|
|
|
|
|
You also need to close and re-open the form or whatever container (like a UserControl ). Also, the new assemblies aren't copied into the target directory until you build the project with the dependencies on the other.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi!.
There's a way to write an application such as Visual C++ SDI app., with multiple views, (forms views)?.
For example: I have two bars and selecting differents options, (buttons), I want to change the visualization, (the controls are others), in a kind of view or window in the center.
I use to do that with SDI application in VC++, but how could I do the same in C#.
Thank you.
Demian.
|
|
|
|
|
|
Is there any way to get processor related data from C#? I know there is Win API procedure but it, as far as I know, gives me specification related data (type, speed, etc).
I need something, to be specific => that will tell me % of processor ocupancy so I can for example when processor ocupancy drops below 10% to take some action.
Any ideas?
|
|
|
|
|
I've never done it, but one way you can do this is using the PerformanceCounter class. Read the docs-- it's pretty easy to understand how to go about it.
-Jeff
here, bloggy bloggy
|
|
|
|
|
|
Check out the class and all the other classes from Mentalis.org. I've used the this one before. It works pretty good.
CpuUsage[^]
The CpuTime class is a class that can query the current CPU load. This is sometimes useful to dynamically adjust performance settings in server applications.
This class is available in C# and VB.NET; it can be compiled to .NET modules or libraries to be used in other .NET languages. Since it relies on the Windows API, it will not work under Linux or FreeBSD.
I'm using it on a webform too.
webform[^]
|
|
|
|
|
Hi, I'd like to know how to use a Windows device driver (ex. parport.sys) in C#. I've been looking everywhere on the net but I haven't found any information about it!
|
|
|
|
|
Files like parport.sys have no exported functions, so you can't P/Invoke them. You need to either use the drivers through the HAL (or whatever is appropriate, like using the Windows Image Aacquisition (WIA) APIs.
Another option is to use Managed C++ and wrap the functionality in a managed class that you can use in your C# code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I want to change the enter key action to do what the tab
key does (to change what was EnterAction property)
|
|
|
|
|
Handle the KeyDown event and use SendKeys.Send("{TAB}") as one example. If the text is currently being edited, then the TextBox hosted in that cell has the focus, so you should also also hook the KeyDown event of the DataGridTextBoxColumn.TextBox property and handle that in a similar fashion if this is the behavior you want while editing.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I'm using Xml in c#. I want to use XSLT to sort the xml-file. This code is used when clicking on a button.
XslTransform trans = new XslTransform();<br />
trans.Load(@"c:\XSL.xsl");<br />
trans.Transform(fileName,destinationPath);
When i run this code the compiler stops right after this line:
trans.Load(@"c:\XSL.xsl");
He says there is a system error.
trans.Transform(fileName,destinationPath);
In this line he says something about "Obsolete" and "you should pass xmlresolver to transform() method"
Anybody an idea?
thanx a lot
|
|
|
|
|
In .NET 1.1, a lot of the methods on XslTransform are obsolete - meaning they will go away in a future version. You should not use them. Of course, if you intend to support .NET 1.0 you don't have a choice. Reading the documentation will help you determine what's obsolete, what's new, and how to use the classes instead of just using IntelliSense and guessing.
This is only a warning, though. If you're getting an error that either stops the code from compiling or that is getting thrown at runtime, then that's a different problem and you should post the exact exception that's being thrown.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
The exact exception is weird.
He says:
An unhandled exception of type 'System.Xml.XmlException' occurred in system.xml.dll<br />
Additional information: System error.
He always stops at the line after this code:
trans.Load(@"c:\XSL.xslt");
no mather what i write so the problem is something with that line but it looks allright to me.
If this doesn't work, maybe you know a different way to sort my xml?
Thx a lot
|
|
|
|
|
It's likely that either your XSLT document is not well-formed XML or that you haven't specified the XSLT namespace (http://www.w3.org/1999/XSL/Transform).
Also, this is definitely the easier way. The only other way would be to navigate the DOM and either sort the data yourself or use an XPath navigator and wrote-out the DOM again in a sorted manner. XSLT does this for you.
It does work, but you're doing something wrong. The two problems I mentioned above are most likely the problems.
If you open your XSLT document in Internet Explorer, it should tell you where the error is if the document is not well formed (this is pretty simple to do programmatically too, but using IE you don't have to write anything). If the XSLT namespace isn't included, then your document is technically NOT and XSLT.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
thanx! the namespace was the mistake, but it's an url so does the computer need an internetconnection for it to work?
I searched for this a looooong time, thanx a lot. But there are probably still some mistake in my xslt. He writes a new xml file which is good but he doesn't write the attributes so <library name="t"> becomes <library> and he doesn't sort the xml
so i'll still be busy for while
thx again
|
|
|
|
|
No, a namespace is just a logical qualifer. It could be "asdf" or something like "urn:schemas-microsoft-com:office:word". So long as the XML document and XSLT agree on a namespace (the prefix doesn't matter), then the elements and attributes (though attributes usually aren't namespace-qualified) refer to the same thing. If they don't have the same namespace, then even elements named the same thing are the same thing.
You should read about XML on http://www.w3.org[^], especially XML namespaces.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
YES it finally works, took me about 2 weeks
Nothing is better then making a program work
if your interested this is the XSLT file:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()">
<xsl:sort data-type="number" select="loadorder"/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Thx again for the help, it's great that you help so many people (i see your name at almost every question)
|
|
|
|
|
how i can write Ackermann Function not use recursion
Nothing
|
|
|
|
|
Excuse the dumb question:
Why would you want to? It's defined recursively, right? C# supports recursion...so what's the issue?
Bill
|
|
|
|