|
blakey404 wrote: at System.Net.Mail.SmtpClient.Send(MailMessage message)
It must catch it (you still dont say the exact exception type I was asking for), if it does not, either your code is wrong, or something else.
So how do you get that stacktrace? How did you print it out/copy it?
I also note, you turned off debugging (and hence no linenumbers). It is not possible to accurately pinpoint the exact exception point in an optimized run mode.
Lastly debugging a service is no more dificult to debug than any other application.
1. Start service.
2. Set a few breakpoints.
3. Attach to service process with debugger.
4. Wait for exception.
|
|
|
|
|
i see something else thats wrong-ish
your compiler should be giving you a warning "ex is declared but never used"... if you don't intend on using ex don't declare it...
catch (Exception)
{
eventLogImport.WriteEntry("SMTP Email error: could not send email.", EventLogEntryType.Warning);
}
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
It is indeed , i intend to use Exception ex once i can actually catch the exception!
|
|
|
|
|
if thats the case than its all good
ive seen programmers IGNORE compiler warnings and that just irritates the living S**T out of me... just thought id point it out incase you didnt notice
good luck
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.passion != Programming)
|
|
|
|
|
haha thanks
|
|
|
|
|
I'm searching for a source code for scanning a PC for installed software (versions) and then check a definite web site for updates.
|
|
|
|
|
hellkiller wrote: I'm searching for a source code
Then Search Google
|
|
|
|
|
hi! it's again me I want to know something...I have a listview and I am populating the list with files from ftp folder. I want to get just the xml files, so that means...only file who are finishing with extension '.xml'.
I am doing like this:
I am making a function where it get's all the files like this:
StreamReader reader = new StreamReader(response.GetResponseStream());
string line = reader.ReadLine();
while(line !=null)
{
result.Append(line);
result.Append("\n");
line = reader.ReadLine();
}
it works fine and I am getting all the files in that folder, but I want to get just the xml files...any help with that? Thx ahead
|
|
|
|
|
well, I guess System.IO.Path.GetFileExtension is a good place to start, if you're unable to do the filtering at the point of asking for the group of files ( which I know you can do if you're searching the local file system )
Get the extension, call ToLower() ( so that XML, Xml, and xml all match ) and check if it's .xml. If it is, add it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thx, that helped me a lot...and I solved it...have a nice day
|
|
|
|
|
You can use System.IO.Directory.GetFiles(<<directory name>>"*.xml"); to return a list of files that end with xml.
|
|
|
|
|
where exactly I can put the System.IO.Directory.GetFiles(<<directory name>>"*.xml")?
I tried something like this:
string[] xmlFiles = System.IO.Directory.GetFiles("ftp://URL", "*.xml");
but it doesn't work, can you pls show me how should I use, cause I haven't used before. Thx ahead
|
|
|
|
|
I don't think it will work for FTP, that's what I was alluding to in my reply. So, you need to filter them manually, in the manner I suggested.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how can I get the cputime dedicated to a specific thread?
|
|
|
|
|
You can do this on a process level, not sure about thread level.
|
|
|
|
|
|
System.Diagnostics.Process.GetCurrentProcess().TotalProcessorTime
|
|
|
|
|
got my 4 rate,thanks
|
|
|
|
|
hi guys, I have a question, I want to know how I can store credentials(username, password) once they will be entered and if the user checks the checkbox that he wants to have them stored, so they will not care about typing again when they will visit again the app. It's not a web app, it's a desktop app. Thanks in advance
|
|
|
|
|
You could encrypt the data and then store it in the registry
And when the user signs in the next time just pick up the values from there and pass it to the Authentication system you are using
hope it helps
|
|
|
|
|
However you like. Registry/XML/app config/database/whatever
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
there are many ways to get your goal, store them to file, registry or configuration file(AppSettings), for example, you just store them to your configuration file, if the setting key is exist and its value not empty then use them as stored credential data, but you must encoded them for security purpose
dhaim
program is hobby that make some money as side effect
|
|
|
|
|
Write a file that contains this information and read it back in later on. This is consistent with the way that websites do it using cookies.
using (IsolatedStorage storage = IsolatedStorage.GetUserStorForDomain())
{
using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream("MySession.xml", FileMode.Create, storage)
{
fs.Close();
}
} To read it back in...
using (IsolatedStorage storage = IsolatedStorage.GetUserStorForDomain())
{
using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream("MySession.xml", FileMode.Open, storage)
{
fs.Close();
}
} The advantage of this method (using IsolatedStorage) is that it can only be read by the user/assembly that created it, and is completely Vista friendly.
|
|
|
|
|
freinds
can any body tell me how i can add child node to any existing root node
programetically.
wasim khan
|
|
|
|
|
The root node will have a collection of children you can add your node to. I suspect if you typed this question into google and added C# to it, you'd get plenty of great examples.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|