|
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
|
|
|
|
|
|
|
Have a look at the MSDN Nuggets videos on debugging. There's one called "Tools for Debugging" or something like that. There's a whole section just on VS 2005 debugging. But some of it is applicable to VS 2002/3 debugging too. You will get some ideas from watching a few of them.
http://www.microsoft.com/uk/msdn/events/nuggets.aspx[^]
Kevin
|
|
|
|
|
Hi all
I'd like to write a Winform application (C#) which shut down the computer after certain minutes but i don't know how to call and which WIN32 API to do this.I've read an article on this site about that but it's not clear.Please help me.Tnx
|
|
|
|
|
|
Hi,
I would like to know how to use code to change text's font and style within a text box or an enrichtextbox. Thank alot
|
|
|
|
|
|
is it possible to change partially of the document's style and fonts within the enrichtextbox?
|
|
|
|
|
Is there anyway to embedd a J2ME/J2SE application into C#? For example, i have the code for a small java game, i want it to be able to be ran in c#, is there anyway? maybe thru j# or something?
|
|
|
|
|
Sure, compile the Java code as J#. From there, you can call the methods in your J# application from C# as if it were written in C#.
Also, an alternate route is compiling your code using Mono's IKVM[^].
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
Is there a way to specify a timeout to StreamReader.ReadToEnd() ?
Thanks,
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
No, there isn't.
Why would yo want a timeout for something that returns the contents of the Stream immediately? What are you trying to do?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|