simple code from c# App to ASP.net
- Status: Closed
- Pris: $10
- Bidrag mottagna: 4
- Vinnare: TCrabtree
Tävlingssammandrag
I have already code in c# which enables to change specific line in Textbox1 based on the start word in the line.
For Example: If those 3 lines written in TextBox1:
Hello Every body
Hi
Welcome
I want to change the line which starts with "Hi" to "Hi Every body".
This is the code in c# desktop App:
void changeLine(TextBox RTB, int line, string text)
{
int s1 = RTB.GetFirstCharIndexFromLine(line);
int s2 = line < RTB.Lines.Count() - 1 ?
RTB.GetFirstCharIndexFromLine(line + 1) - 1 :
RTB.Text.Length;
RTB.Select(s1, s2 - s1);
RTB.SelectedText = text;
}
Then i call the Function like this:
int linenumber = TextBox1.GetLineFromCharIndex(TextBox1.Text.IndexOf("Hi: "));
changeLine(TextBox1, linenumber, "Hi Every body");
This works only in c# desktop App. I want to use some thing like this in ASP.NET C#
Rekommenderade kompetenser
Topp bidrag från den här tävlingen
Visa fler bidagKlargörandetavla
Hur du kommer igång med tävlingar
-
Lägg upp din tävling Snabbt och enkelt
-
Få massvis med bidrag Från världens alla hörn
-
Utse det bästa bidraget Ladda ner filerna - enkelt!