|
i want to run a file past to my function with the default program reader, that is:
if the file passed is a .xls run that file in Microsoft Excel,
if it is a .gif run the file in the Windows Image Preview
if it is an .html run the file with Explorer, and so on...
|
|
|
|
|
Simple. Just launch the file using the Process[^] class, just like launching any .EXE. Make sure you set the ProcessStartInfo.UseShellExecute property to true. This will make it launch just like you double-clicked it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Anyone know if any links or where I get a COM for it?
I need to read the bulkmail folder.
Any Ideas, other than peeking at windows all day.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Outlook Express doesn't expose a COM model.
It does, however, make heavy use of the Messaging API[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I just wanted to read the bulk mail.
I can create my own, but then I would have to add all the additonal support for news and junk. Which I dont want to do.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
So just code reading the mail! Where did you get this "You MUST implement a news reader." junk?
Outlook Express uses the MAPI API to download mail from a server. If that's all you want to do, then you just use the MAPI API to do it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, but since hotmail and others are a POP server then it pops off.
Using MAPI, can I just peek at the message? Rather than taking it. I don't want this to become a mail application, or at least not right now.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
MAPI is not a way around the features of a POP3 or SMTP server, it is an interface to use those servers. If the server does not support "peeking" at a message, then you can't peek at it.
Most server, though, will let you download a message AND leave it on the server. You just have to check with the POP3 spec to see what the standard commands are and see if MAPI will support them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, I wasn't sure.
I didnt want to actually take them away, then I would need all kinds of functionality. I just want to scan the messages for spammers And report them.
Thank you for helping.
Thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
in design mode i've set a textbox PasswordChar to *
During the running i want to go back the password textbox to normal, so to let see all the characters.
How can i do?
|
|
|
|
|
this.textBox1.PasswordChar = char.MinValue;
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
it doesn't work.
I see ******* anyway
|
|
|
|
|
That's odd - It works for me.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
// In C# 2.0, you can use the default keyword.
this.textBox1.PasswordChar = default(char);
|
|
|
|
|
i can't use default(char), maybe i've not c# 2.0 becouse i'm in VS.NET 2003
|
|
|
|
|
Yeah, in VS 2003, one can only use .NET 1.1. All you need to do is set the PasswordChar property to whatever is the default value for a character. I believe the default character value is '\0'.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
I use this:
txtPassword.PasswordChar = '\0'; and it works in .NET 1.x.
I hope it helps!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
|
I'm wondering is there a way to add my own link to the default page that users see when going to the webservice in a browser. I'd like to be able to link to a document (or pdf, or html page) with better specs on the webservice than just the descriptions that you can supply in the WebMethod's Description attribute.
My articles
BlackDice
|
|
|
|
|
Hello,
I am trying to store boolean expressions such as "((_ltv >= 80) && (_escrows == 2))" in a SQL Server Table. The objective is to open up the table from C# and pass these expressions into a parameter named "_reason" so that _reason contains the expression described above. Then using the method below to test if the conditions in the expression are true. If the expression is true, then to return the amount of the adjustment assigned in the record for that particular expression or condition.
private void testCondition()
{
try
{
if (_reason)
{
MessageBox.Show("The adjustment is \n" + _adjustedPrice.ToString());
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
|
|
|
|
|
You can't store an expression in a variable. You can store it as text in a string, but then you have to parse it somehow to evaluate it.
If all expressions have the same form (comparing variables to a span of values), you can just store the spans for each variable and compare them.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for you response. I realize that the variable must be initially stored as a text expression and then somehow converted to a valid boolean expression. My question is how does one convert a boolean expression originally stored as text into a valid boolean expression that can be evaluated? Surely this must be possible somehow. Actually I had success hard-coding the expression to an object and then converting to boolean as detailed below: The catch is storing this "object" expression in SQL and then loading it into the object variable and then converting the expression from an object to a valid boolean expression
If C# allows the following expression to be used in an "if" statement then there must be someway to convert the expression from a text to a boolean.
This works:
object _condition = NULL;
_condition = ((_loanPurpose < 3) && (_programGroup == 3) && (_approvalLevel == 8) && (_agency == 1) );
bool _reason = false;
_reason = Convert.ToBoolean(_condition);
if (_reason)
{
_adjustPrice += -1.000;
}
Is there a way to store an object that looks like the expression above in a SQL fields and then loading into an object variable to be converted to a boolean expression like above?
|
|
|
|
|
The object that you have created doesn't contain what you think it does. The expression is first evaluated, then the result (a boolean) is boxed into an object. The reason that you can convert it to a boolean is that it already is a boolean.
Evaluating an expression is a bit more complicated than that. Look at this example: Compiling C# Code at Runtime[^]
---
b { font-weight: normal; }
|
|
|
|
|
besides 'trial and error' are there any good debugging tutorials? thanks
|
|
|
|
|
...---... wrote: besides 'trial and error' are there any good debugging tutorials?
Isn't that what debugging mostly is? You write code, you try it out, an error is generated, you examine the value of the variables, the objects, take note of the exeption that was thrown and try again setting a breakpoint somewhere before the error to see the flow of the application to determine why it went wrong.
Then once you understand that you write a unit test to ensure that code path has a test, if it didn't already, so that if the error rears its ugly head once more then you see it instantly in the unit tests.
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|