Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to block a Website using c# Pin
Md. Marufuzzaman10-Oct-09 3:35
professionalMd. Marufuzzaman10-Oct-09 3:35 
QuestionChange windows options - Hide actions buttons Pin
missceline339-Oct-09 4:18
missceline339-Oct-09 4:18 
AnswerRe: Change windows options - Hide actions buttons Pin
OriginalGriff9-Oct-09 4:27
mveOriginalGriff9-Oct-09 4:27 
GeneralRe: Change windows options - Hide actions buttons Pin
missceline339-Oct-09 4:31
missceline339-Oct-09 4:31 
GeneralRe: Change windows options - Hide actions buttons Pin
OriginalGriff9-Oct-09 4:43
mveOriginalGriff9-Oct-09 4:43 
GeneralRe: Change windows options - Hide actions buttons Pin
missceline339-Oct-09 6:20
missceline339-Oct-09 6:20 
GeneralRe: Change windows options - Hide actions buttons Pin
Dave Kreskowiak9-Oct-09 6:12
mveDave Kreskowiak9-Oct-09 6:12 
Questionplease help me with my c# project language acceptor Pin
Tabang9-Oct-09 3:49
Tabang9-Oct-09 3:49 
please help this program will check if the letters inputted are any number of "X" in the beginning and then any number of Y or no Y at all in the middle then any number of X in the end both x in the beginning and end must be the same numbers if it is valid or invalid..
#Valid inputs:
xxyxx , xyx , xxxx , xxxyyyyxxx, xx, xxxxyxxxx,
#invalid inputs:
xyxx , xxyx , yyyyyy , y , xxxxyx, xxxxy, yxxxxx

i managed to get all of them into there proper validity except the input "xx", "xxxxxxxx", xxxx... if there is no Y in the input if will have an error of "index out of range exception was unhandled ,index was outside the bounds of the array".... please help me correct it please here are the codes........

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LanguageAcceptor
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
int countx1 = 0, countx2 = 0, i = 0, x = 0, y = 0, letterctr = 0;
char[] pew = textBox1.Text.ToCharArray();
int len = pew.Length;

while (i < len)
{
if(pew[i].Equals('x')||pew[i].Equals('y'))
letterctr++;
i++;
}
if(letterctr==0)
{
MessageBox.Show("Valid");
}
else if(letterctr == len){
if(pew[0].Equals('x')){
while(pew[x].Equals('x')){
if(x==len)break;
countx1++; x++;
}
Array.Reverse(pew);
while(pew[y].Equals('x')){
countx2++;
y++;
}
if(countx1==countx2){
MessageBox.Show("Valid");
}
else
MessageBox.Show("Invalid");

}
else
MessageBox.Show("Invalid");
}
else
MessageBox.Show("Invalid");
}
}
}

Confused | :confused:

modified on Friday, October 9, 2009 10:05 AM

AnswerRe: help me pls..........help me with my codes Pin
OriginalGriff9-Oct-09 4:03
mveOriginalGriff9-Oct-09 4:03 
GeneralRe: help me pls..........help me with my codes Pin
Calla9-Oct-09 4:05
Calla9-Oct-09 4:05 
GeneralRe: help me pls..........help me with my codes Pin
OriginalGriff9-Oct-09 4:12
mveOriginalGriff9-Oct-09 4:12 
GeneralRe: help me pls..........help me with my codes Pin
Calla12-Oct-09 20:07
Calla12-Oct-09 20:07 
AnswerRe: help me pls..........help me with my codes Pin
Calla9-Oct-09 4:03
Calla9-Oct-09 4:03 
GeneralRe: help me pls..........help me with my codes Pin
Tabang9-Oct-09 4:09
Tabang9-Oct-09 4:09 
GeneralRe: help me pls..........help me with my codes Pin
Calla14-Oct-09 1:53
Calla14-Oct-09 1:53 
AnswerRe: please help me with my c# project language acceptor Pin
OriginalGriff9-Oct-09 4:15
mveOriginalGriff9-Oct-09 4:15 
AnswerRe: please help me with my c# project language acceptor Pin
PIEBALDconsult9-Oct-09 4:50
mvePIEBALDconsult9-Oct-09 4:50 
QuestionIs C# the preferred language to develop BHO in IE8? Pin
Ziink9-Oct-09 3:36
Ziink9-Oct-09 3:36 
AnswerRe: Is C# the preferred language to develop BHO in IE8? Pin
Dave Kreskowiak9-Oct-09 6:10
mveDave Kreskowiak9-Oct-09 6:10 
GeneralRe: Is C# the preferred language to develop BHO in IE8? Pin
Ziink9-Oct-09 10:42
Ziink9-Oct-09 10:42 
QuestionAssembly.load Pin
shivapriyak9-Oct-09 2:12
shivapriyak9-Oct-09 2:12 
AnswerRe: Assembly.load Pin
Eddy Vluggen9-Oct-09 2:25
professionalEddy Vluggen9-Oct-09 2:25 
GeneralRe: Assembly.load Pin
PIEBALDconsult9-Oct-09 4:48
mvePIEBALDconsult9-Oct-09 4:48 
GeneralRe: Assembly.load Pin
Eddy Vluggen9-Oct-09 7:45
professionalEddy Vluggen9-Oct-09 7:45 
GeneralRe: Assembly.load Pin
Daniel Grunwald9-Oct-09 6:26
Daniel Grunwald9-Oct-09 6:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.