|
Unmodified, no. A validator in ASP.NET takes the name of a control which it finds in in the control collection of the container. This wouldn't work for Windows Forms. You can use the code, though. There's other code out there as well, including an MX validator I wrote a long time ago that I believe I posted in this C# forum over a year ago. Good luck finding it, though. In any case, DNS queries are a standard so the only real difference in code is how you do it.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Blake,
Just my two cents. I had this same problem where I work with a list of over 2 million. The final solution that I implemented was to send all of the emails with a unique identifier in the return address. Like so: member_number@yourdomain.com.
Then when a bounce occurs, the email will come back to our server. I use exchange so I had to write an event sink to parse the email address that was coming in and get the member number from whence it bounced and then update that member's email valid in our database. Not sure if this will work for you depending on your setup.
It was tricky but we have it running perfectly now and we now bounce only 2% of our very large lists. One thing we had to keep in my mind was that there are different types of bounces, hard, soft, etc... Most mail servers will send this information back to you in the "bounce" email header and it is up to you to handle it accordingly. For us, we allow 3 soft bounces or one hard.
Like I said, it was a little tricky but we cut our bounces down DRAMATICALLY. If you are interested in the details and some sample code, just reply here and I will get it to you.
Thanks,
Troy G
|
|
|
|
|
Troy,
This is exactly what I have been thinking about doing (I read an article about it on this website), and I thought that I might even combine it with the MX checking that other people had posted about.
I would love to see some details and code if you want to send it to me. Maybe I can figure out a way to make it work for our purposes. You can send it to blakeb_1@hotmail.com
Thanks a lot
Blake
|
|
|
|
|
Troy,
Actually, I've just realized that this isn't going to work because the mailing list program we are using isn't going to allow to do any extra programming.
I think I might just stick to verifying through the smtp servers for now, and hopefully it will at least cut down on a little of the bounces. Thanks for offering to send some code though.
Blake
|
|
|
|
|
Hi Troy G,
I am working on a project where i need to track bounced mails and update the database with types of bounce. I am able to send a unique identifier in the return address. Each time there is abounce the mail with the unique identifier is there in the bounce box. Now, the problem is reading the Headers like the member_number in member_number@yourdomain.com and the bounce type and updating it to the database. If u have any idea or code that can do this, then it would really be a great help.
I am interested in getting the details. Thanking you in advance.
With Warm Regards,
Arvind
|
|
|
|
|
I created a control based on pictureBox with transparency. Worked great until I openned the Windows 2000 task manager. Blam, the transparency is gone! Fiddled for a while and got it back, tried the task manager again and blam, transparncy is gone again. The same executable still has transparency in XP.
Whazup?
Thanks in advance.
|
|
|
|
|
Are you using TransparentBackground style? If so, overrice CreateParams, so if the window does need to recreate it self, it will do so properly.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Yes, I'm using the TransparentBackground style and I'll try your suggestion. This seems to be related to the CLR attaching the debug stuff to the program. It seems that in Windows 2000, when the debugger is running in the background the transparency is off, but if it isn't running the debugger, the transparency is on. I'll continue to investigate, unless somebody already knows the answer.
Thanks,
Joe
|
|
|
|
|
I have an inherited dialog, that wont fire the validating and validated events for the form, or the inherited yes no buttons. They do have causes validation set to true, in both the base class and the child class. I also have some other input fields that are not inherited from the base control and their validating and validated events are fired just fine. I tried manually hooking up the events from base class to inherited class, with no luck. Any suggestions?
Thanks,
Ryan
|
|
|
|
|
Overriding base class methods and not calling the base class's method will cause this.
override void OnValidate(EventArgs e)
{
base.OnValidate(e);
}
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I tried to make a private method virtual, and got the following error:
error CS0621: '***' : virtual or abstract members cannot be private
Is it really possible that private methods can not be virtual in C#, or I am making some terrible mistake here?
Thanks.
|
|
|
|
|
Look at the protected keyword...
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Use protected . Private members are only accessible to that class, so how can a derivate class override them?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
Private members are only accessible to that class, so how can a derivate class override them?
What do you mean? Virtuality has nothing to do with access rights. In C++ it is perfectly legal (and useful) to override a virtual private function.
Anyway, after googling a little bit, I found out[^] that even CLR supports private virtual methods, and that this is a C# restriction 
|
|
|
|
|
Exactly - because it doesn't make any sense. If you RTFD for the C# specification, you'd know this. And it does have to do with access rights because a private member cannot be accessed by either the base or derivative classes so it can't be overridden. Since it can't be overridden, there's no need to mark it virtual! It may be allowed in IL, but it certainly doesn't make sense and hence C# restricts it. This explanation is even given in the C# language documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
because a private member cannot be accessed by either the base or derivative classes so it can't be overridden.
I may be stupid, but why a method can't be overriden if it can not be accessed? What one has to do with another?
[edit]
BTW, take a look at this article[^] if you don't know why overriding private members is useful.
[/edit]
Also, I did read the C# language spec. but can't recall any mention of this. Would you tell me exactly where this was mentioned?
|
|
|
|
|
Okay, lets say for a second that C# allowed virtual on a private method. Fine.
A private method cannot be accessed (except through reflection) by neither the base class or any derivative classes. This means you can't override it because it can't even be seen by either of those classes.
And its not allowed in C# to use override on a method or property that isn't virtual .
If you read through the C# Language Specification[^] on MSDN it is mentioned (perhaps implied - it's been a long time). 3.5.1 states that privates are limited to the containing class only. The rest is mentioned in 10.2.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
A private method cannot be accessed (except through reflection) by neither the base class or any derivative classes. This means you can't override it because it can't even be seen by either of those classes.
Please read the article I left a link to.
|
|
|
|
|
Fine. Great. Even interesting! But that's C/C++. C# is a different language and .NET presents a somewhat different concept. So IL supports it virtual privates. Most languages don't. While the C# language supports most of the CLI features, many languages don't support even half of that.
If you want to know specifically why Microsoft choose not to support this construct, ask them.
As far as the C# compiler goes, virtual methods calls use the callvirt IL instruction. But the C# compiler doesn't allow access to private members so callvirt - as far as the C# compiler is concerned - can't call the private method. Maybe there is good reason for it, but - as I said - only the C# engineers can answer "why".
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
To satisfy my own curiosity, I sat down and threw this together and you're right - it does work:
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 1:1:4322:0
}
.assembly Test
{
.ver 1:0:0:0
}
.module Test.exe
.class public auto ansi Test
{
.method public hidebysig static void Main() cil managed
{
.entrypoint
.maxstack 2
.locals init (class Test t)
newobj instance void Test2::.ctor()
stloc.0
ldloc.0
callvirt instance string Test::Print()
call void [mscorlib]System.Console::WriteLine(string)
ret
}
.method public hidebysig specialname instance void .ctor() cil managed
{
ret
}
.method private hidebysig virtual instance string Print() cil managed
{
.maxstack 1
ldstr "From Test (Private)"
ret
}
}
.class public auto ansi Test2 extends Test
{
.method public hidebysig specialname instance void .ctor() cil managed
{
ret
}
.method private hidebysig virtual instance string Print() cil managed
{
.maxstack 1
ldstr "From Test2 (Private)"
ret
}
}
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
A private method cannot be accessed (except through reflection) by neither the base class or any derivative classes. This means you can't override it because it can't even be seen by either of those classes.
You missed one VERY VERY important other method...
The fact that an enclosed class has access to all its contained class's members, thus infact allowing a private member to be theoritcally marked virtual and to be overriden if the enclosed class derives from it's contained class. Make sense?
class Test
{
virtual void TestMethod(){}
class Test2 : Test
{
override void TestMethod(){}
}
}
In my opinion this should be allowed!
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I didn't miss nested class definitions, merely forgot them during this discussion.
If either of you want this supported by C#, why not email Microsoft? While they're adding functionality to to the language right now, it would be a good time.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Nahh i'm too lazy and my email is still broken.... anyways internal protected does enuf for me
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
I need to send a file between a server and client machine, and although I assume I will need to use serialization I do not seem to be getting very far has anyone attempted this before?
|
|
|
|
|
Is it on the same network? Can't you use an UNC path and CopyFile?
|
|
|
|