Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
GeneralRe: Starting service from another Pin
Heath Stewart21-Jul-04 5:51
protectorHeath Stewart21-Jul-04 5:51 
GeneralProb with service Pin
SatyaDY20-Jul-04 18:00
SatyaDY20-Jul-04 18:00 
GeneralRe: Prob with service Pin
Heath Stewart21-Jul-04 4:50
protectorHeath Stewart21-Jul-04 4:50 
QuestionHow to do with SVG path string? Pin
luming112233445520-Jul-04 16:53
luming112233445520-Jul-04 16:53 
AnswerRe: How to do with SVG path string? Pin
J. Dunlap20-Jul-04 19:25
J. Dunlap20-Jul-04 19:25 
Questionwindows doesn't distinguish between stanby and hibernate? Pin
vista2720-Jul-04 16:17
vista2720-Jul-04 16:17 
AnswerRe: windows doesn't distinguish between stanby and hibernate? Pin
Nick Parker21-Jul-04 3:34
protectorNick Parker21-Jul-04 3:34 
GeneralString.Input and StreamWriter Pin
j1e1g120-Jul-04 15:09
j1e1g120-Jul-04 15:09 
Hi all,
I'm working on a method that parses through a html source file, and puts coldfusion comments around script tags. My problem is that the String.Input method is not working with the line read from my streamreader. When using the debugger, it hits the .Input(index, string) line, but it does actually change my string. I think this is because the line is in a stream, but I'm not sure. I know there is a programmatically simple workaround for this, but I haven't done it in so long that I can't remember. Suggestions please - my code is as follows:
private void outputnoscript(StreamReader reader, StreamWriter writer)
		{
			string line = "";
			int opencounter = 0;
			int closecounter = 0;

			while(line!=null)
			{
				line = reader.ReadLine();

				if (line!=null)
				{
					MatchCollection opencollection = Regex.Matches(line, "<script",RegexOptions.IgnoreCase);
					
					for (int i = 0; i < opencollection.Count; i++)
					{
						//insert a <!--- at the position in the current match, +5 for every <!--- already inserted
						Match openmatch = opencollection[i];
						line.Insert(openmatch.Index + opencounter, "<!---");
						opencounter += 5;
					}

					MatchCollection closecollection = Regex.Matches(line, "/script>", RegexOptions.IgnoreCase);
				
					for (int i = 0; i < closecollection.Count; i++)
					{
						//insert a ---> at the position in the current match, +4 for every ---> already inserted
						Match closematch = closecollection[i];
						//plus 8 is to accomodate for the fact that regex returns the position of "/" in "/script>"
						line.Insert(closematch.Index + 8 + closecounter, "--->");
						closecounter += 4;
					}
					
					writer.WriteLine(line);
				}
			}
		}

GeneralRe: String.Input and StreamWriter Pin
Heath Stewart21-Jul-04 4:42
protectorHeath Stewart21-Jul-04 4:42 
QuestionC# Windows Form DataGrid Hyperlink??? Pin
gman4420-Jul-04 14:59
gman4420-Jul-04 14:59 
AnswerRe: C# Windows Form DataGrid Hyperlink??? Pin
Nick Seng20-Jul-04 15:53
Nick Seng20-Jul-04 15:53 
GeneralClick outside of form detection Pin
cdengler20-Jul-04 14:45
cdengler20-Jul-04 14:45 
GeneralRe: Click outside of form detection Pin
J. Dunlap20-Jul-04 19:34
J. Dunlap20-Jul-04 19:34 
GeneralRe: Click outside of form detection Pin
mav.northwind20-Jul-04 20:33
mav.northwind20-Jul-04 20:33 
GeneralRe: Click outside of form detection Pin
cjengler21-Jul-04 1:27
cjengler21-Jul-04 1:27 
GeneralWake up my Display Pin
Trambert20-Jul-04 12:12
Trambert20-Jul-04 12:12 
GeneralRe: Wake up my Display Pin
Heath Stewart20-Jul-04 12:46
protectorHeath Stewart20-Jul-04 12:46 
GeneralRe: Wake up my Display Pin
Nick Parker20-Jul-04 12:47
protectorNick Parker20-Jul-04 12:47 
GeneralFrom DLL Hell to Assembly Hell Pin
Sameer Handa20-Jul-04 9:16
Sameer Handa20-Jul-04 9:16 
GeneralRe: From DLL Hell to Assembly Hell Pin
Heath Stewart20-Jul-04 9:28
protectorHeath Stewart20-Jul-04 9:28 
GeneralRe: From DLL Hell to Assembly Hell Pin
Sameer Handa21-Jul-04 4:22
Sameer Handa21-Jul-04 4:22 
GeneralRe: From DLL Hell to Assembly Hell Pin
Heath Stewart21-Jul-04 4:37
protectorHeath Stewart21-Jul-04 4:37 
GeneralWindows Graphics, or ComboBox Question. Pin
DougW4820-Jul-04 9:07
DougW4820-Jul-04 9:07 
GeneralRe: Windows Graphics, or ComboBox Question. Pin
Heath Stewart20-Jul-04 9:12
protectorHeath Stewart20-Jul-04 9:12 
GeneralRe: Windows Graphics, or ComboBox Question. Pin
DougW4820-Jul-04 10:28
DougW4820-Jul-04 10:28 

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.