|
Try Googling the following string @"open source .net C# Applications"
|
|
|
|
|
I need magic wand c# source code. can any body hep me?
Thanks
|
|
|
|
|
Hi,
I'm not sure anyone should be divulging this information.
See the referenced code of ethics from the IBM Board of Directors [^]
Alan.
|
|
|
|
|
i did not mean copy of magic wand of photshop. I mean, did any body have open source code of similar sctript.
thanks
|
|
|
|
|
I believe Harold Potter wrote an article about this?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Hi
I have a question concerning custom ConfigurationValidator, which verifies the entries in the app.config file. Below is the class which represents the section in the config file.
public class SettingSection : ConfigurationSection
{
[ConfigurationProperty("appId", IsKey=true, IsRequired=true), ConfigurationValidator(typeof(AppIdValidator))]
public string AppId
{
get { return (string)base["appId"]; }
}
}
public class AppIdValidator : ConfigurationValidatorBase
{
public override bool CanValidate(Type type)
{
return true;
}
public override void Validate(object value)
{
string val = (string)value;
Regex regex = new Regex(@"\A\d{4}-\d{4}-\d{4}-\d{4}\z");
if (regex.IsMatch(val))
{
return;
}
else
{
throw new FormatException("Input string is not in correct format");
}
}
}
The problem is when the instance of SettingSection is created, and the validator is called, the metod Validate is called with empty string - no metter what is the value in the app.config file. If I set the DefaultValue of the ConfigurationProperty attribute, than the validator is called with that value - again regardless to the entry in app.config.
Any idea will be appreciated
Uros
|
|
|
|
|
Hi guys,
I've implemented the code from http://www.neowin.net/forum/lofiversion/index.php/t180600.html[^] into my project (the latest post). Now I wondered: If I go commercial, is the use of the Windows file copy utility legal? This is of great importance, since almost my entire project depends on this code.
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:59am.
|
|
|
|
|
stancrm wrote: I think
I need more certainty than that, but thanks for your reply.
Anyone else knows?
Motivation is the key to software development.
|
|
|
|
|
Zaegra wrote: I've implemented the code from http://www.neowin.net/forum/lofiversion/index.php/t180600.html[^] into my project
If you have implemented code from a different forum, why not ask this question at that forum, as we do not know what their rules are.
|
|
|
|
|
That question is easy to answer: That thread has been abandoned a million years ago, plus, I find the Codeproject a very reliable source of information. That's why I posted the question here, and not there
Motivation is the key to software development.
|
|
|
|
|
Well their site displays no copyright notices apart from for the theme it uses for display. The code is given freely with no copyright notices and is in the public domain so I would say yes - go ahead and use it.
If you want to be absolutely sure, email the site admins to check.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hello! I'm new to C# programming and I have an issue with getting a textbox string to convert to a double.
I'm not sure where I went wrong in the following code, but MS Web Developer isn't liking it:
dEarn = Convert.ToDouble(sEarnings);
dHealth = Convert.ToDouble(txtHealth.Text);
d401k = Convert.ToDouble(txt401k.Text);
I'm trying this two ways: 1) Where "sEarnings" is a string equal to textbox input, and 2) Where I simply try to convert the textbox input directly. Neither way seems to work, and to add clarity, all of this is happening under a Button_Click void.
Thanks!
|
|
|
|
|
Have you looked into using Double.TryParse() instead?
|
|
|
|
|
Tried dEarn = Double.TryParse(sEarnings);... MS Web Developer complains "No overload for method 'TryParse' takes '1' arguments"
|
|
|
|
|
|
Don't use a TextBox for numeric values; use a NumericUpDown.
|
|
|
|
|
This is a project specifically utilizing textbox input. Many tools aren't available to me yet as I am a beginner with C#, though I do have some VB experience. So I don't necessarily know or understand all of the possible ways around an issue.
Basically, think of the most common, elementary way you'd handle this problem and that is likely my answer.
|
|
|
|
|
Double.TryParse and dont forget formatting and the Culture you are addressing
|
|
|
|
|
Thanks, Natza - but I don't understand what you mean by "culture".
Here's what I'm working with, all under a Button_Click void. I've got an ASP page interacting with this back code. The user enters a number string in a textbox, I want to convert that string into a double and do a calculation. I don't want to test the input here for a boolean yes/no, I want to convert the string a use it.
-------------------
protected void btnCalc_Click(object sender, System.EventArgs e)
{
String sName = (txtName.Text);
String sEarnings = (txtEarnings.Text);
String sHealth = (txtHealth.Text);
String s401k = (txt401k.Text);
dEarn = Convert.ToDouble(sEarnings);
dHealth = Convert.ToDouble(txtHealth.Text);
d401k = Convert.ToDouble(txt401k.Text);
<other code,="" etc....="">
}
--------------------------
|
|
|
|
|
I gave you the answer; see my message above.
|
|
|
|
|
Hi,
When converting from or to strings (even calling ToString(), you should ALWAYS use the culture in which you intend the formatting for. A general rule of thumb is always use English (us or uk) for internal stuff such as application logs and exporting/importing internal data, this way even when your software or data is moved between computers with different languages it will work. Use the UI culture and number formatting in the UI layer for UI interaction.
Look at this horror:
10.000
An American or english computer will read this as 10$
and a french, german and others will read this as 10000$
Fun fun fun
I think your code should look something like this:
String sEarnings = txtEarnings.Text;
double earnings;
bool earningsParseOk = Double.TryParse(
sEarnings, System.Globalization.NumberStyles.Any,
System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat,
out earnings);
if (earningsParseOk)
{
}
else
{
}
|
|
|
|
|
gtr1971 wrote: think of the most common, elementary way you'd handle this problem and that is likely my answer
Mine too -- a NumericUpDown.
|
|
|
|
|
I replied to someone else by a mistake, please see my coomment, code included
|
|
|
|
|
Hi all
I must define a Hash Rule to control execution of a software from running by a human on a specific station.
I don't have the source code of software and so ... .
What i am doing is that this software must only be exceuted by another software written by me.
So a user may copy the installed files (on another PC) to the specified station and execute it (so bad).
So a Hash Rule is maybe the best method.
What i want is exactly that how to programmatically creating and dropping a "hash rule".
I don't want to manulally set the hash rule.
Note:
In Windows XP pro:
Run -> gpedit.msc -> Computer Configuration/Windows Settings/Security Settings/Software Restriction Policies/Additional Rules/ Right Click on the right panel / New Hash Rule ...
thanks
|
|
|
|