|
Most bots stick an extra header in the message, such as a tracking number. NNTP (newsgroups) also do something similar for tracking purposes. You could use the subject, but your parsing algorithm will have to take many different things into account (such as the language of the reply, whether "Re:" is used or another string). So, you'd add a header and your email message would look something like this:
Subject: Welcome. Please Reply.
Content-Type: text/plain
X-TrackingID: 0123456789
Welcome. Please reply to this message so we may verify your email address. Typically, you should prefix your custom SMTP headers with "X", to signify that this is an extended header. You'll see this a lot with things like X-Mailer , X-Priority , etc.
You could further create this tracking ID and store that in the database. When you get an email back, check for the header and update the record in your database using the tracking ID in your WHERE clause or something.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
How can I circulate through all controls on the form, know which one has a dynamic property, and save all changes to app.config?
In fact, how do I write to app.config in code in the first place?
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
There is no support for writing to a .config file like you can read from it in .NET. Being that it is just an XML file, you can use the classes in System.Xml to write to it.
I recommend you DO NOT save your controls to a .config file, though. This is meant for application settings, not necessary serialized content. In order to use the ConfigurationSettings mechanism in .NET effectively, you should also implement the IConfigurationSectionHandler interface so that you can get the configuration object easily using ConfigurationSettings.GetConfig . For a good article on extending this type of behavior, see Nick's article, An extension for a Configuration Settings class in .NET[^].
If you want to do what you need, you'd be better off using serialization. See the System.Xml.Serialization namespace for simple XML serialization, or the System.Runtime.Serialization for more advanced serialization, which probably wouldn't be necessary in your case. For more information on serialization in .NET, see Serializing Objects[^] in the .NET Framework SDK.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Heath Stewart wrote:
See the System.Xml.Serialization namespace for simple XML serialization...
Thank you very much, that was so helpful.
Sammy
"A good friend, is like a good book: the inside is better than the cover..."
|
|
|
|
|
Hi,
We have all strings that were not auto-generated stored in special resource files.
I notticed that if the code refers to a non-existent resource string the compiler will not let you know about it, and you will find out things are not right until run time.
Do you know of a way to make the compiler tell me about the resource problems?
Thanks,
Elena
|
|
|
|
|
elena12345 wrote:
Do you know of a way to make the compiler tell me about the resource problems?
Code better
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Yeah, thanks a lot
I am just moving a bunch of code.
And a bunch of resource strings have to move from one file to another.
So I want to make sure I didn't leave anything out.
Don't tell me to architect better. I didn't architect this thing
Elena
|
|
|
|
|
You could have an external application use reflection on your assembly to check for completeness.
You could do something like create string contants in a certain namespace and have this program use reflection on that namespace to get each string constant. It could then use reflection to make sure the resources contain something named the same thing.
You could then make this "check" part of your build.
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
|
|
|
|
|
The compiler (csc.exe in this case) doesn't care about resource files, just like the resource compiler (resgen.exe) doesn't care about source code.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am trying to add a control in a panel from another thread than the on who created the panel.
So in this case I have to use the invoke method on the panel control to do that : this.Controls.Add(...).
My code is working very well on the framework, but with the same code, I have an Argument exception on the Compact Framework.
If Smbd has an id.
Thanks
|
|
|
|
|
MobileLover wrote:
If Smbd has an id.
Make sure the method you are calling via invoke is infact available on the compact framwork.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Yes it is a method written by me !
|
|
|
|
|
I wrote a Form that acts as a slightly more sophisicated MessageBox. The only thing I cant do is make my application wait for the user to make his selection and hit OK before continuing (sp?).
Please let me know if there is an easy way of doing this. Hopefully without sitting in a while loop waiting for a flag.
Thanks,
Matt
|
|
|
|
|
myform frm = new myfrm();
if(frm.Showdialog()==DialogResult.OK)
{
}
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
Looks like you beat me to it this time Mazy.
- Nick Parker My Blog
|
|
|
|
|
Nick Parker wrote:
Looks like you beat me to it this time Mazy.
Yah, I exercise a lot to beat competitor.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
spindar wrote:
Please let me know if there is an easy way of doing this. Hopefully without sitting in a while loop waiting for a flag.
Have you looked into the DialogResult enum? You can do things like this (similar to how the MessageBox works):
Form2 fr = new Form2();
if(fr.ShowDialog().Equals(DialogResult.OK))
{
MessageBox.Show("Hey");
}
- Nick Parker My Blog
|
|
|
|
|
Thanks for the help and the fast response
Matt
|
|
|
|
|
Sorry for the basic post, but I have looked everywhere and I can't figure out if this is possible or not. I am wondering if it is possible to check and variable to see if it is between certain ranges of numbers using a switch statement.
Ex:
switch (int){
case (between 1 and 10):
case (between 11 and 20:
and so on. Let me know if know.
Jason
|
|
|
|
|
you can preprocess the number a bit beforehand like switch(int/10)
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Another way is to combine (encode) 2 numbers into 1 eg:
Required range: 22-63
int range = (22 << 16) + (63 & 0xFFFF);
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
This is one of those features that VB has that I wish C# supported. You can just add case statements for each of the values adding the break statement to the last case in the range
switch (value)
{
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
DoSomething ();
break;
}
not pretty but it works.
|
|
|
|
|
I am not sure if this is in the right board, but i'll post anyway. I am looking for suggestions as to the best way of implementing the system for my company. These systems are completely new so there are no backward compatibility considerations.
The company currently has 10 clients (which is likely to rise rapidly) that need to connect to a SQL Server database to get a record, edit it on screen and return the results. The connection needs to be made in such a way that no 2 clients can get the same record. What I really need are some suggestions as to the best way of implementing this. I am quite new to C# and .net as a whole, so my current solution is to use an asp.net application which uses a web service to access a stored procedure. The stored procedure has the logic in it such that it will stop multiple gets of the same record.
I have been doing a little bit of research and have found that the same desired effect may be achieved with COM+ and MTS or using .net remoting. As I have experience with neither of these technologies I would be grateful for some pointers. The web service route works in my test environment, but I need a system that will be suitable of an ever increasing client base.
Jason Pyke
|
|
|
|
|
Hey man, I can't understand why do you want to go for ASP.NEt,web service or remoting? You can easily have a windows application which connect to a databse and do what ever they want. You can isolate recored too. What do you exactly mean by 2 client get same record? You could change your databse/code design to doing something like this, not go for rmoting,WS or...
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
The only reason I am using ASP.net is that it is possible in the future that the application may need to span sites. When I say 2 clients can't get the same record I mean that there will be a table containing records A,B and C and if 2 clients request a record at the same time client 1 will get record A and client 2 will get record B (client 1 and 2 can't have record A at the same time). Do you think it's worth creating a winforms application on a shared directory for this type of application? My main worries with a winform approach (with no data tier) are scalability and bug fixing (I have had a situation with a previous company where I have had 50 people accessing an app I am trying to compile).
|
|
|
|