|
|
Sorry
with a spoonful of lateral thinking I read your sentence "Note that it is possible to invoke the hidden virtual method by accessing an instance of D through a less derived type in which the method is not hidden" as "WTF just give the method a name that remains visible...".
|
|
|
|
|
That wasn't my sentence; it's a quote from the linked document... I need to find a clearer way of indicating such.
|
|
|
|
|
There is no escape, it is your post that led to a solution...
|
|
|
|
|
Hi,
How many maximum Threads can be created in CLR Thread pool?
|
|
|
|
|
The standard thread pool allows 25 threads per processor, but there are a number of improved thread pool implementations that allow you to go beyond this. You may want to look at this[^] implementation.
|
|
|
|
|
MSDN does not give a specific number, but it does list a number of remarks.
In short, you dont know (which means it may vary), and dont exagerate !
|
|
|
|
|
Hi!
I want to to fire a number of asynch method calls from a main thread and have the main thread return true synchronously if the method calls all return true, otherwise false.
The asynch method calls should have a timeout which makes them return false. How to best implement in .NET 2.0? Performance is an issue!
Pseudo code:
<br />
public void main() <br />
{<br />
SynchObj sObj = new SynchObj();<br />
bool allTrue = sObj.SynchCall();<br />
}<br />
<br />
public class SynchObj<br />
{<br />
public bool SynchCall() <br />
{<br />
bool allTrue = false;<br />
<br />
<br />
return allTrue;<br />
}<br />
}<br />
<br />
public class AsynchObj <br />
{<br />
public bool AsynchCall(int timeout)<br />
{<br />
}<br />
}<br />
|
|
|
|
|
Have you looked at WaitHandle.WaitAll ?
only two letters away from being an asset
|
|
|
|
|
And hello again !
I have a problem. I was using a soap serialization in assembly called "Catalog". I've got a file Data.xml.
Then i was trying to serialize this file to another program ("LogBook").
I've got error:
Parse Error, no assembly associated with Xml key a4:http://schemas.microsoft.com/clr/nsassem/CatalogBeta/Catalog_2.0%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull strBook
What should i do ? How can i deSerialize this file ?
One nation - underground
|
|
|
|
|
The assembly you are serializing into also needs to know about the data structure that was serialized. If you want to serialize the data like this, you will need a third intermediary assembly that contains the class definition that is referenced by both of the other assemblies.
Remember, serialization and deserialization are essentially a transport mechanism to take the binary state of an object from one context (serialization) and transfer it to another context (deserialization). Both contexts must understand the data structure being manipulated.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
I would like to be able to let people enter special fields and HTML into a Rich Textbox and then have it convert to HTML. Here is the plan. Let's just say I have these 2 fields, firstname and lastname. What I would like to have happen is to allow the end user to save this....
<br>#firstname#<br>#lastname#
into a text document and then I would have the app read the text document in, look through the doc for those special words and then replace them with the real values from the database. With that information I would just send it to browser object for display. What this is for is a phone integration and when the user clicks on the incoming call I would like them to see more information about who is calling. Giving the user a tool to add any fields they want and being able to format it anyway would be cool. I'm just not sure how to make sure everything stays HTML safe with chars like " ' / and the like. Anyone doing anything like this or could lead me into the correct direction please? Much thanks!
-- modified at 14:47 Monday 2nd July, 2007
|
|
|
|
|
Hello Everyone,
The last time I did any Windows/Win32 programming was before .NET was introduced!! Since then I've been focused on server-side Java applications but now I need to develop a Windows service. I figure C# should ease the transition into .NET and so I'm writing to this forum. If this is not the right forum for this question, please let me know which one is.
I'm looking for pointers on the quickest approach to go about implementing a service which listens in on both SMTP and POP3 traffic and based on the message headers perform some action. The behavior is just like an anti-spam application's service that monitor email.
So far, I've found sample code for creating a service. I'm hoping to find sample code for intercepting SMTP/POP3 traffic as well as an API similar to JavaMail which will help with parsing RFC822 messages.
If anyone here has previously developed an anti-spam application and is willing to be a consultant, please contact me directly. This would actually be my preferred approach.
Thank you.
Siraj.
Siraj Podikunju
SP Consulting, Inc.
sirajp@spconsult.com
|
|
|
|
|
Hi all, I want to download an xls file from remote location (Please note that its not FTP , its live ip, like myip/shared/info.xls) .I have been searching for any class or library but no success till yet. Can someone help me ? Thanks in advance.
Also, please guide how to open an excel file for reading data from it. Thanks
Kaliem
|
|
|
|
|
|
ah sorry, I forgot to inform, I am trying this with windows forms application, not web application, I guess incase of web, you can also do that using Response object, but I am looking for some control/class/library in windows app.
kaliem
|
|
|
|
|
What do you mean "remote location"? Across your network or the internet?
only two letters away from being an asset
|
|
|
|
|
Both! I want to be able to access files over my network and internet. like the file URL would be something like ipaddress/foldername/filename.xls
|
|
|
|
|
Process.Start("IExplore.exe", "\\ipaddress\foldername\filename.xls ");
Process.Start("IExplore.exe", "http:\\ipaddress\foldername\filename.xls ");
Provided the files is accessable from http of course.
only two letters away from being an asset
|
|
|
|
|
thanks for that, yes the file is accessible from http.
Yet to implement that code but my guess is, it would prompt the user to download that file. Is that possible if we can just save the file in a specific place instead of prompting.
Kaliem
|
|
|
|
|
Kaliem,
See my first response to your question. The component described in the article does what you are asking. It takes a URL to a file over HTTP and downloads it to a given location.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Because the process being started is IE it will attempt to open the file just as any valid URI, however because of the file association IE will use MS Excel as the viewer. There is no need to download the file.
only two letters away from being an asset
|
|
|
|
|
Given the following class hierarchy and simple Program.Main
using System;
using System.Collections.Generic;
using System.Text;
namespace GenericTest
{
class Base
{
public void Name()
{
Console.WriteLine("I'm a Base class");
}
};
class Middle : Base
{
public new void Name()
{
Console.Write("I'm a Middle class");
}
};
class Child : Middle
{
public new void Name()
{
Console.Write("I'm a Child class");
}
};
class Program
{
static void PrintName<t>( T instance ) where T : GenericTest.Base
{
instance.Name();
}
static void Main(string[] args)
{
Child c = new Child();
PrintName<child>( c );
}
}
}
I see the following output
I'm a Base class
And I would have expected to see
I'm a Child class
Is this a bug with Generics or is it a side effect of how the Generic is generated for reference types?
Thanks
Matt Schuckmann
|
|
|
|
|
Hi,
it is correct by definition of the C# language.
You tell PrintName it is accepting objects of type Base,
hence instance.Name() actually is a call to Base.Name().
Exactly the same thing would happen when you do:
static void SomeMethod(Base instance) {
instance.Name();
}
If you want to get Child.Name() you should make Name() virtual and override it,
instead of using the "new" keyword.
|
|
|
|
|
The wayI understood the where statement is that I'm telling it to accept objects derived from type Base or that have the same interface as type Base. If I wanted to tell it to accept objects of type Base I wouldn't use a Generic I'd just use a simple method, like you suggested.
So your basically telling me that within a Generic you lose all static type information and everything is staticly bound and treated as if it was the type specified in the where statement. This is really sad your basicly telling me that a generic is no better than a class or method that takes a common ancestor class for whatever types you're going to pass it.
I understand making the method virtual to accomplish the intended results of this example but for reasons out side of this example I don't want the method to be virtual and I wanted to use the hiding semantics of the new keyword.
Thank You
Matt S.
|
|
|
|