|
Trying disabling your antivirus to see if you get the same problem.
If you don't, then it has something to do the the symantec firewall or virus scan.
My signature "sucks" today
|
|
|
|
|
I have verified that the antivirus software running on my machine was the problem. Your help is appreciated.
|
|
|
|
|
The suggestion made by Abhinav may help; if it does not, then:
SmtpClient implements IDisposable so it may be that the email is sent when the client is disposed. This would give the symptoms you describe, at least in terms of the send-when-application-closed problem. Try wraping your section in a using block.
using (SmtpClient client = new SmtpClient(smtp_server.Text))
{
MailMessage message = new MailMessage(send_from.Text, send_to.Text);
message.Body = mail_body.Text;
message.Subject = mail_subject.Text;
client.Send(message);
message.Dispose();
}
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Thanks for your reply. I tried that and got the following compile time message:
Error 1 'System.Net.Mail.SmtpClient': type used in a using statement must be implicitly convertible to 'System.IDisposable'
I will do more research on this matter. Thanks!
|
|
|
|
|
My apologies, it looks like MS are lying again... SmtpClient @ MSDN[^]
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
OriginalGriff wrote: it looks like MS are lying again
Hmm. Continuously improving themselves, that is what they are doing. It took them till 4.0 to realize SmtpClient had to implement IDisposable.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
After disabling the antivirus program, the original program sends the email immediately when the button is clicked. That indicates that the antivirus was the problem.
I still don't understand why closing the program bypasses the antivirus program's scanning of the email.
Another issue is that it's hard to ask the program's users to turn off their antivirus program to facilitate the healthy running of my program.
My solution to the problem may be to use separate processes for sending emails. I can spawn a small program just to send an email. It terminates by itself right after the mail is sent.
Thank you for your time!
|
|
|
|
|
loyal ginger wrote: Another issue is that it's hard to ask the program's users to turn off their antivirus program to facilitate the healthy running of my program.
I can see where that might be a problem.
loyal ginger wrote: My solution to the problem may be to use separate processes for sending emails. I can spawn a small program just to send an email.
But if you gotta, you gotta. What kind of virus scanner are we talking?
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
I have "Symantec AntiVirus" version 10.1.5.500 on my development machine. It's hard to predict what antivirus software will be on my client's machine. I am lucky to see this happen on my machine. Sometimes a fully tested application craps out on client's machines because some other software's interference, making the software developers look bad. I hope that does not happen to me.
|
|
|
|
|
I would suggest you try .NET 4.0 and use the new SmtpClient.Dispose() method (directly or through a using statement, doesn't matter). I haven't done so myself yet, but it seems to be a new enhancement by MS, and I expect it to solve your problem.
Of course, you should not disable or replace your AV.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi all!
I've tried to create file using File.Open(filePath, FileMode.Create) where filePath contains Unicode symbols. I can see those specific symbols in the explorer but if I try to read folder content via cmd dir I see only "Filename (??????? ???)" where question char replaces desired symbols.
Even more. When I tried to open file from the Explorer I received an error "file does not exist". But opening from cmd with (?????) is OK.
Can anybody help me? Thanks in advance
|
|
|
|
|
My advice is to not use unicode characters in paths/filenames.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
how to get the number of words in .doc OR .docx (MicrosoftWord file).
I will give the address of word file and i wanna get the number of words in it.
Thanks
|
|
|
|
|
Find the number of bytes, divide by two.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
OriginalGriff wrote: Find the number of bytes, divide by 42.
FTFY.
I don't think they have cut down on the overhead.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Tools | Word count
|
|
|
|
|
I wanna to get this in my C# project.
So Please Help or Give correct solution .
Thanks
|
|
|
|
|
Take document as string
Use regex to remove all numbers and punctuation
Split on CRLF for paragraphs, Split on space for word count
That would be my first attempt, and then I would be asking questions on any problems I had. So, maybe you should go and implement that and see if it gets you what you want, then come back and ask specific questions.
|
|
|
|
|
Thanks for you reply and solution .
Is it possible for you to give me small example .
|
|
|
|
|
Why not just ask someone to write this for you? A big part of being a developer is to know where to find knowledge and learning how to do it yourself.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: Why not just ask someone to write this for you? A big part of being a developer is to know where to find knowledge and learning how to do it yourself.
I agree with you
I just found enough examples how to archive it and I sent him/her link in my previous post.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
I made a simple query on google, and I got this result[^].
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Record a macro that gets the word count using Tools -> WordCount
and transform that to C#.
Easy
That's if you're OK with interop.
Just an irritated, ranting son of ... an IT guy.
At your trolling services
|
|
|
|
|
You can use the Word API. If you open a Word Document using the API, the DocumentClass has a property called "Words". This returns a Microsoft.Office.Interop.Word.Words class that has a count property.
See this page: Microsoft Office Development.[^]
Choose the version that you're working with and read up on the API. You can retrieve that information very easily using it.
|
|
|
|
|
Are there any C# FTP client libraries or components that support the XCRC command to verify integrity of an uploaded/downloaded file?
Thanks
|
|
|
|