|
String [] str = new String [8];
str[0] = "a1";
str[1] = "b1";
str[2] = "c1";
str[3] = "d1";
str[4] = "e1";
str[5] = "f1";
str[6] = "g1";
str[7] = "h1";
then i want to take input
for(int i = 0; i < 8 ; i++)
{
input = Console.ReadLine()
source1=str[i].CompareTo(input);
Console.WriteLine(source1);
if(source1 != 0)
{
Console.WriteLine("no");
Console.WriteLine(i);
}
else
{
Console.WriteLine("yes");
Console.WriteLine(i);
temp3 = i;
i = 9;
}
i always say no if i take input within the loop. and work correctly if i take input out of loop. but i want untill user give correct input it takes input again and again. how i will do this .
|
|
|
|
|
How the crap do I put a parenthesis in a string in C#???
I want to do this... string asdf="(";
/\ |_ E X E GG
|
|
|
|
|
Why not try before you ask? That is exactly how you do it. There is nothing special about having a paranthesis in a string. It's just like any other character.
---
b { font-weight: normal; }
|
|
|
|
|
how about in java?
/\ |_ E X E GG
|
|
|
|
|
String asdf = "(";
Same escape sequence rules in C, C++, C#, and Java.
|
|
|
|
|
Must be something else you are doing. That should work.
The only tricky character is the backslash. It is the escape character for non-printing and control characters, so you have strange constructions like:
string abcd = "\"\\\"";
That translates to a string containing double-quote backslash double-quote.
|
|
|
|
|
I'm trying to create a launcher program that will automatically update files for another program and then launch that updated program. The launcher and the main app have already been created as seperate VS .Net projects(.exe). My question is would it be possible to build the main app as a dll, reference it in the other project and then have the launcher update the dll and launch it? Any sort of help would be greatly appreciated.
Code first, ask questions later.
|
|
|
|
|
|
Hm. This provides the same sort of functionality I'm looking for, but since I've already wrote the auto-updater I'm just wondering if there is an easy way to integrate two projects so one can open the other. Both are .exes right now, I would like the internal problem to be a .dll.
|
|
|
|
|
What you want to do is called "late binding". Search on that term and you will find several articles.
|
|
|
|
|
Hello,
Is there a way of making a specific cell in the column of a Grid - ReadOnly.
Thank you.
|
|
|
|
|
Short answer: No.
Long answer: Uhmmm... well... yes. But its a bit complicated:
You will have to inherit from the DataGridTextBoxColumn and override the Edit function. Here you could throw an event with CancelEventArgs, catch it somewhere outside and determine from the CurrentCell whether it should be ReadOnly or not (and set the Cancel of the EventArgs).
|
|
|
|
|
Hello,
Is there a way to implement a div operation on two numbers?
I need the quotent result.
So if I have two decimals, and my result after division is 5.2, I need only 5.
Thank you
|
|
|
|
|
|
Thank you.
By the way, do you know how to format the decimal output to only 4 decimal points?
If I have:
decimal totalArea = (NetRes * DevRes);
how do I format totalArea to have 4 decimal points?
Thank you.
|
|
|
|
|
You don't format totalArea to 4 decimal digits. You could round it to 4 decimal digits, which is a bit different:
totalArea = Math.Round(totalArea, 4); Here you are changing the number itself. Also, you can convert to string with 4 decimal digits:
string area = totalArea.ToString("0000"); This last statement will fill area with the string representation of totalArea , with 4 decimal places. totalArea won't be modified and will keep all its digits.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Thak you.
Luis, wanted to ask you one more question.
I have a dataview on a Table, and I apply a RowFilter on it:
dataview.RowFilter = "TimelineID IS NULL";
If I output the dataview.Count, it equals 2. So, do you know how I can access these rows in dataview? I don't want to use dataview.Table.Rows, becuase it returns all the rows in the dataview.
Thank you
and sorry to bother you with so many questions
|
|
|
|
|
<code>foreach(DataRowView row in dataview)
{
int x = (int) row["x"];
} or you could also:
int x = (int) dataview[rowIndex]["x"]; zaboboa wrote:
Thank you
and sorry to bother you with so many questions
Don't worry, I'm here to help! You're very welcome!
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
i have a program, that scan files in a directory .
i need to know, if is the file open or in edit mode, or if it Changes the size.
Is there any way to do that, any method like IsOpen?
|
|
|
|
|
I think you could simulate it. Try to open it, if it works, then it isn't open otherwise it's close.
Niklas Ulvinge aka IDK
|
|
|
|
|
Did anyone has seen a C program that fixes JPEG header files? I've saw it before and unfortunately haven't had time to copy it down. I would love to compile it and run it. Any tips in tracking position before pointer and after pointer would also help, I've always thought it was *+1 or *-1 Thanks!
|
|
|
|
|
Say that i want to get the text that is found on a specific line of the text box... (say line 5). How do i do that? Pls help.. thx
|
|
|
|
|
|
|
Hey, thx everybody
|
|
|
|