 |
|
 |
Apologies for the shouting but this is important.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 3.67/5 (10 votes) |
|
|
|
 |
|
 |
For those new to message boards please try to follow a few simple rules when posting your question.- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers, Chris Maunder
The Code Project Co-founder
Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 4.40/5 (4 votes) |
|
|
|
 |
|
 |
Has anybody seen a full implementation for a date(time) class/struct in C#?
I don't need this for a project or anything (the built in one seems adequate for dealing with date and time constructs for business apps). However, I have a friend who is trying to pick up some of the more arcane OO concepts in C# and I thought such an example might give good coverage of operator overloading, serialization, etc. I had to do one way back in the day with C++, so I thought something similar might be a handy way of explaining the same concepts to him.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
I dont know in which forum i have to post this issue. If i am wrong please guide me to post in which form
I am developing a vb.net desktop application that reads mails from the mailserver using pop and imap .
The application is almost fnished .The problem is the some time when a command is send to retrieve a mail using GetMessage() functions the applications is going to a halt
So I tried to run the the code in debug mode and ran line by line . What I noticed is in the while loop in GetMessage() function is
While Not tmpString.StartsWith(sPrefix) tmpString = reader.ReadLine msg = msg & tmpString & vbCrLf End While
The reader reads line by line at certain point of time it got hangs
Some times it ill catch an exception and give an error . I am pasting the exception below "Received an unexpected EOF or 0 bytes from the transport stream"
But some times the applications will hang and go for a halt .This applications has to run 24/7 .So if it hangs in the night or it will be problem .
What I want is if the reader is not able to read from the stream after certain time period . the control has to be removed from the reader and the function has to return a message . I am new to this the network level applications and I am running shot of time So I am in big trouble . If anybody knows this problem please help me
I have pasted the code briefly so that you can get an idea about the program
Dim objTCP As New TcpClient Dim sslstream As Net.Security.SslStream Dim reader As StreamReader = Nothing objTCP.Connect(IMAPserver, Port)
sslstream = New Net.Security.SslStream(objTCP.GetStream()) sslstream.AuthenticateAsClient(IMAPserver) ' authenticate as client GMAIL AuthStatus = sslstream.IsAuthenticated reader = New IO.StreamReader(sslstream)
Function GetMessage(ByVal sCommand As String, ByVal sslstream As SslStream, ByVal reader As StreamReader) As String Dim tmpString As String = "" Dim msg As String = "" Try
sendcmd(sCommand, sslstream) tmpString = reader.ReadLine() If tmpString <> "" Then msg = msg & tmpString & vbCrLf End If While Not tmpString.StartsWith(sPrefix) tmpString = reader.ReadLine msg = msg & tmpString & vbCrLf End While If InStr(msg, "BAD Could not parse command") > 0 Then 'MsgBox("BAD GETMESSAGE") End If Catch ex As Exception appendFile(strErrPath, "Error in GetMessage, BAD command : command : " & sCommand & Space(3) * "User: " & UserName & ex.Message & Date.Now) End Try
Return msg End Function
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi I have to create a windows application which can connect to a remote host through SSH and can perform some operations on the remote host. remote host is a cisco router 3745 Problem I am facing is which ssh client to use and how to use in the application. If anybody knw please update me @ himanshu_agarwal@live.com / himanshu.agarwal@gmail.com
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi.,
How to print a crystal report in a dotmatrix printer using vb.net code and printing should be fast?
Any ideas...
Thanks & Regards Raj
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hi Raj
You can use 12dpi fonts, all your crytal report contents to be printed should be in 12 dpi font.
These fonts are added to windows fonts once you install Dot matrix printer drivers.
if these fonts are used printing will be faster compared to windows fonts
cheers saleem
cc
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I would like to know if is there any parameter which let me ask for confirmation of the Mail arrival using System.Net.Mail and the sender SMTPClient.
modified on Thursday, November 19, 2009 7:47 AM
|
| Sign In·View Thread·PermaLink | 1.00/5 (5 votes) |
|
|
|
 |
|
|
 |
|
 |
You need to refactorize the incoming param list, and possible invoke the method if concurrency is required, also create a method extension this will help during execution of the object.
Hope this helps. Further help can be found in the correct programing forum - which I'm sure you will find - assuming you have the aptitude to program computers.
|
| Sign In·View Thread·PermaLink | 5.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
While the above suggestions are all perfectly valid, you may want to consider calling Reflector programmatically with parameters for each version of the .Net Framework. This will give you the option of seeing what your options are for a variety of deployment scenarios.
Once you do that, you can then use Reflector to dynamically decompile System.Net.Mail into usable code which you can then modify to suit your needs.
One such modification you'll want to make sure you do before proceeding any further would be to create a hash structure so that you can easily ascertain whether or not you've already sent an email. Naturally, this hash structure should be built to serialize to the hard disk when memory consumption is too high. This will reduce your overall network overhead and improve your performance.
Trust me, your manager will thank you just for following those 3 simple steps.
Visual Studio is an excellent GUIIDE.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
What your a masochist. You've been here a while and asked some sensible questions in the C# forum and suddenly you do a Don Juan and tilt a programming question at the Lounge, consider yourself SMACKED, now go back to the C# forum and ask this question.
Ahhh I enjoyed that, we don't get enough of these misplaced questions any more.
Never underestimate the power of human stupidity RAH
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Ahh bugger CP moved it. They are taking our targets away, I think we need to protest this.....
Never underestimate the power of human stupidity RAH
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Ok, here is the problem that drives me nuts.
I have a datagrid with various data.The first column is the date of the record and it's a string.
The following code gives the error
tempor=Month(dgv1(0, counter).Value.ToString)
On my PC the code works flawlessly.But when i give the application to someone else for BETA testing, it produces the error.
Does it make sense to you ? I also tried all the variation to the code, i could think of, like using cdate and cstr functions, changing the type of the tempor variable to date, string, using the .string or not at the ende of the code, to no avail
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Johnkokk wrote: Does it make sense to you ?
Not exactly; your title says you are converting from the string "18/8/2009", but your code is converting something ToString(). Can you clarify a bit more what is in dgv1(0,counter)?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
The field of the datagrid contains "18/8/2009".This is a string. I am trying to get the month part of this date.
On my computer whatever i try WORKS. On the other PC whatever i have tried, DOES NOT. Even if i don't put the .string, DOES NOT work on the BETA tester.
To make it simple.How do i get the month part of the above field to use as an index in an array ?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Τhe problem seems to be the regional setting of the other pc, which are different than mine.If they are change to the same as mine, it works Hmmmmm
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
you could split the string ( string.Split() ) and then take the second index of a string array, then you have the number of the month, maybe you could work with that?
Here we rest... So why not make the best of it? 
|
| Sign In·View Thread·PermaLink | 1.00/5 (2 votes) |
|
|
|
 |
|
|
 |
|
 |
it seems you don't have a clue.
the only thing that could go wrong in tempor=Month(dgv1(0, counter).Value.ToString) is a NullReferenceException due to dgv1 or Value being null.
if there is a problem, it is bound to be in a different line. Look at the entire exception.ToString() output, tell your IDE to show line numbers, and get the line at fault.
Most likely it is about date formatting. The first thing about it is you have to decide whether you want a user-selected format (through Regional Settings), or a fixed format (specified explicitly in your conversions, see the Parse/TryParse method overloads that take explicit format info).
Luc Pattyn [Forum Guidelines] [My Articles]
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Your problem is that you are storing your dates as strings. THIS IS WRONG AND VERY STUPID. This is error number 1 when a newbie starts working with dates. You should IMMEDIATELY go back and change your date storeage and manipulation from string to datetime.
Dates are subject to the computers cultureinfo, this means if the user has not changed the culture of the computer from the default american format (stupid friggin mm/dd/yyyy yank format) your 18 is being read as a MONTH, If it was a datetime format you would not have this problem.
Never underestimate the power of human stupidity RAH
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |