|
class Program {
static void Main(string[] args) {
string b = "3.12312123";
if ((b[0] == '2' || b[0] == '3' || b[0] == '4' || b[0] == '5') && ((args[0] == "703") || (args[0]== "733"))) {
Console.WriteLine("OK");
} else {
Console.WriteLine("NOT OK!");
}
}
}
Merry Christmas.
"Simplicity carried to the extreme becomes elegance."
-Jon Franklin
|
|
|
|
|
Your problem displays the most common failure of beginning programmers -- mixing their 'AND' and their 'OR' logic.
You also need to think of how to address your other requirement that the text begin with 2,3,4, or 5.
A possible solution is first to write what you want out in text
if b starts with a valid number and textbox contains valid numbers then it's ok.
That leads to code such as this:
string b = "3.12321212";
List<char> validValues = new List<char> { '2', '3', '4', '5' };
List<string> validInput = new List<string> { "703", "733" };
textbox1.Text = "Not OK";
if ( validValues.Contains( b[0] ) && validInput.Contains( texbox.Text ) )
{
textbox1.Text = "OK";
}
Another way you can also address this problem is with RegEx but I don't have the time to figure out the pattern.
|
|
|
|
|
Ok... thank you all for your answers. Will try this tommorow. Again, thanks for your patience and the will to help.
Good night
Regards,
Matjaž
|
|
|
|
|
Hello
I have just updated a control in my project and cannot access the Design panel because of teh following error:
ResX file Could not load file or assembly 'Xceed.Chart.Core, Version=4.2.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6' or one of its dependencies. The system cannot find the file specified. Line 7585, position 5. cannot be parsed. ---> System.Xml.XmlException: Could not load file or assembly 'Xceed.Chart.Core, Version=4.2.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6' or one of its dependencies. The system cannot find the file specified. Line 7585, position 5. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Xceed.Chart.Core, Version=4.2.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6' or one of its dependencies. The system cannot find the file specified.
File name: 'Xceed.Chart.Core, Version=4.2.100.0, Culture=neutral, PublicKeyToken=ba83ff368b7563c6'
Where do i delete the bad reference?
The program works but i cannot edit the GUI because of the error.
I am using VS2008 SP1
is there a workaround?
Thanks
Have a nice Day
|
|
|
|
|
Go to the solution explorer, and look at the properties of the reference to the Xceed library. It should have a property called "Specific Version". Set the property to false and rebuild.
If it's a custom library, then check wether the ResX is read-only. I've had some issues with the Interop-toolkit on the generation of resource-files (binary resource not checked out by sourcesafe and being readonly)
Good luck
I are troll
|
|
|
|
|
When I build a project by visual studio 2008, and then copy to a computer equibed with windows XP to run it, It have errors, So I want to know how to confugation to get the release version of my project?
Error message:
The application initialization(0xc0000135)failure, Click OK to close it
I searching in google but didn't find a answer, Maybe I'm a beginner,
Addition: My question is how to confugation to make the final program run in a machine without .Net framwork?
modified on Thursday, December 18, 2008 10:28 AM
|
|
|
|
|
I'm sorry to post such a simple question in this, but I'm eagar to know the answer, thank you
|
|
|
|
|
Wait more t hen 4 minutes before you post again how eager or urgent it is. If someone here wants to help or knows, they will reply. Otherwise, start hitting google for an answer.
|
|
|
|
|
Hi,
If you want any help you will need to let us know exactly what error message you see and when you see it.
Alan.
|
|
|
|
|
It would help if you told us what the errors were.
Simon
|
|
|
|
|
In Solution Explorer, Check inside Properties folder , there is a files
Assemblyinfo.cs . Open it, check there is a statement
[assembly: AssemblyVersion("1.0.0.0")]
You can change it from here.
Or,
Right Click on Project in Solution Explorer -> Properties -> Select Application Tab ( By Default Selected ) -> Click on Assembly Information Button.
From here you can configure the version.
cheers,
Abhijit
|
|
|
|
|
1) Make sure you've built a "release build"
2) Make sure the target PC has the necessary runtimes. This probably means the .net framework, which isn't installed by default on XP, so you'll need to make sure the user downloads and installs it first.
|
|
|
|
|
Copy pasting the release folder (as I think you are doing) is not the way to deploy a program.
Since you need .net framework (that could be causing the errors)
You might need several dll's that aren't in the release folder (that could also could be causing the errors)
You should add a new project to your solution of the type setup project.
Add your project output to the application folder, maybe add a few shortcuts as you see fit, build that and use the .exe and .msi that it creates to install your program.
Other that this I can't give you more help with the information you provided
|
|
|
|
|
My wild guess would be that the target machine doesn't have .Net Framework installed. But again the error message would be of a great value.
Regards,
Lev
|
|
|
|
|
|
Assuming it's a C# program that sounds like the .net framework isn't installed on the target PC.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi,
0xc0000135 used to be the magical error code one got when trying to run a .NET app on a machine without (the right version of) .NET
I believe MS finally found a way to produce a more appropriate message; IIRC it is part of some system update.
Anyway, check for .NET presence, it typically can be seen in C:\Windows\Microsoft.NET\Framework
|
|
|
|
|
Can anyone help please!
I am trying to create a list of labels poulated from one textbox, so when i click the button it passes the code to label 1, then label 2, then label 3 etc. I have included the code for a real simple way of doing it, but i dont want a massive list of "if, else if statements", there must be an easier way. Hopefully this makes sense!
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
label1.Text = "";
label2.Text = "";
}
private void button1_Click(object sender, EventArgs e)
{
if (label1.Text == "")
{
label2.Text = "";
string a = textBox1.Text;
label1.Text = a;
}
else if (label1.Text != "")
{
string a = textBox1.Text;
label2.Text = a;
}
}
}
}
|
|
|
|
|
So basically you want to type some text into a TextBox, and when you click a button it starts at label1 and sets its text, then goes to the next label the next time the button is clicked?
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
yes, but if i only add or click five times, then i only get five labels with populated text.
|
|
|
|
|
Just new up a new label, add it to your forms Controls container, and set its properties as you like them (e.g. get the position and size of the previous label, and use that to set the position of the new one)
|
|
|
|
|
Dave Fitter wrote: I am trying to create a list of labels poulated from one textbox, so when i click the button it passes the code to label 1, then label 2, then label 3 etc. I have included the code for a real simple way of doing it
I didn't get the meeaning of above.
Are you talking abut having a list of Label controls?
Cheers!!
Brij
|
|
|
|
|
I am using the following code to validate date in entered in ASP.NET Textbox using Regular Expression;
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown">
<asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" controltovalidate="TextBox1" errormessage="Incorrect format" validationexpression="^(d{0}|(31(?!(Feb|feb|Apr|apr|Jun|jun|Sep|<br mode=" hold=" />sep|Nov|nov)))|((30|29)(?!Feb|feb))|(29(?=Feb|feb(((1[6-9]|[2-9]\<br mode=" xmlns:asp="#unknown">
But its not giving the required output
Guide me pls
|
|
|
|
|
Validate Expression that i used is:
ValidationExpression="^(d{0}|(31(?!(Feb|feb|Apr|apr|Jun|jun|Sep|
sep|Nov|nov)))|((30|29)(?!Feb|feb))|(29(?=Feb|feb(((1[6-9]|[2-9]\
d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00
)))))|(29(?=Feb|feb(((0[48]|[2468][048]|[13579]
[26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8])[/](Jan|jan|feb|Feb|mar|Mar|may|May|apr|Apr|jul|Jul|Jun|jun|Aug|aug|
Oct|oct|Sep|sep|Nov|nov|dec|Dec)[/]((1[6-9]|[2-9]\d)\d{2}|\d{2}|d{0})$"
Date format is dd/mm/yyyy
|
|
|
|
|
Remove the line breaks in the pattern before you paste it in the property in the validation tag.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|