|
Wow, what a long post...
Anyway, StreamReader class can't read remote web pages by itself -supposingly-. You should check the System.Net namespace for classes that read html pages -eg. HttpWebRequest-
By the way, this way you will print the Html of the page. Why don't you check the WebBrowser component? It has a Print() method.
|
|
|
|
|
hi
i want to envrypt/decrypt data (for example video stream) on the fly and play it ?
thanks
|
|
|
|
|
Take a look at the CryptoStream class, acts just like a stream only downside is that I don't think it will finish encrypting or decrypting until the stream is closed (I might have got this confused with the compressor streams such as Gzip but I'm not sure).
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
When I see the application which developed by other people are so cool ,while I can not achieve.Who can tell me how to make the application more cool.
No begin no end.
|
|
|
|
|
Hello
The "cool" word is a bit ill descriptive. Simply the answer to your question is another question:
What did you see in those applications that made you say they are "cool"?
If you already know that answer, then do the same in your applications, but of course in an innovative way -not imitative, ie. don't just copy ideas-
Some hints that might be useful:
1- Your user interface must be compact, user friendly -ie. relaxing to the eye at first look-, yet efficient
2- Your application must have a "genuine" idea -Perhaps this is the most important thing-
3- Your application must be easy to learn, and for advanced features, there should be tutorials or "easy to get" helps
4- Preferably support both beginner, and advanced users
These are not -must follow- rules, just few hints.
|
|
|
|
|
See if we can come up with right phrases for a good application based on your hints:
1 - User Friendly
2 - Creative
3 - Intuitive
4 - Versatile
Best,
Jun
|
|
|
|
|
Nice!!;)
I like the "Shortest distance between two points is a straight line" thinking of yours Jun.
|
|
|
|
|
|
|
Colin Angus Mackay wrote: Talking to yourself?
second time last week someone whined "can't find it on google" 20 seconds later... there it is on my google results. You really gotta wonder when they can't even use a search engine maybe they should consider a different field.
|
|
|
|
|
Hello guys,
I have the following Regular Expression, I want to convert it from PHP to C#.
$aVar = preg_replace("/[\r\n]{1,2}(.+)\#(.*)[\r\n]{1,2}/U", "$myRightVar\\1$myCenterVar\\2$myLeftVar\r", $aVar);
( http://www.php.net/preg_replace )
I tried a lot but I failed. Can you please help me. Thanks.
|
|
|
|
|
The Regex is okay, at least it compiles and Expresso doesn't complain. What shall it match actually?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I'm new to C#. This is the first time I'm using Regular expression. Can you give me the complete C# tag please?
What the code does is taking any line that contains # charachter and add $myRightVar at the beginning of the line then replace # with $myCenterVar and add $myLeftVar at the end of the line.
|
|
|
|
|
|
string regex=@"[\r\n]{1,2}(.+)\#(.*)[\r\n]{1,2}";
string replace=String.Format("{0}\\1{1}\\2{2}\r",myRightVar,myCenterVar,myLeftVar);
string output=Regex.Replace(input,regex,replace);
Haven't got VS in front of me, but this (hopefully) should work.
Graham.
-- modified at 15:34 Sunday 25th June, 2006
|
|
|
|
|
It's almost working... the problem is I'm NOT getting the old left text and the old right text shown. I'm getting \1 and \2.
What's wrong?
Many thanks.
|
|
|
|
|
This is a different approach, maybe it works for you?
string regex = @"[\r\n]{1,2}(.+)\#(.*)[\r\n]{1,2}";
Match m = Regex.Match(input, regex);
if (m.Success)
{
string output = String.Format("{0}{1}{2}{3}{4}\r", myRightVar, m.Groups[1], myCenterVar, m.Groups[2], myLeftVar);
Console.WriteLine(output);
}
Probably this might also work, it's way shorter:
string output2 = Regex.Replace(input, regex, String.Format("{0}$1{1}$2{2}\r", myLeftVar, myCenterVar, myRightVar));
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks a lot but it didn't work for me
The string I am parsing contains the following:
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.
toto toto toto # toto toto toto
toto toto toto # toto toto toto
toto toto toto # toto toto toto
toto toto toto # toto toto toto
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.
So I want to add alter the content on the following way:
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.
[myLeftVar]toto toto toto [myCenterVar] toto toto toto[myRightVar]
[myLeftVar]toto toto toto [myCenterVar] toto toto toto[myRightVar]
[myLeftVar]toto toto toto [myCenterVar] toto toto toto[myRightVar]
[myLeftVar]toto toto toto [myCenterVar] toto toto toto[myRightVar]
And so on...
bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.
Please help.
|
|
|
|
|
This should be it.
string regex=@"(.+)\#(.+)\r\n";
string replace=String.Format("{0}$1{1}$2{2}\r\n","Left","Center","Right");
string output=Regex.Replace(input,regex,replace);
I've tweaked the regex as I was having problem with it.
I've dumped the code I used to test it:
using System;
using System.Text.RegularExpressions;
public class Testy
{
public static void Main()
{
string input="bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla.\r\n\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n"+
"toto toto toto # toto toto toto\r\n\r\n"+
"bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla";
string regex=@"(.+)\#(.+)\r\n";
string replace=String.Format("{0}$1{1}$2{2}\r\n","Left","Center","Right");
string output=Regex.Replace(input,regex,replace);
Console.WriteLine(output);
}
}
|
|
|
|
|
Thanks a lot Graham it worked
|
|
|
|
|
Good to know.
Regexs are good fun, but can be a pain in the a**e sometimes!!
|
|
|
|
|
I have this left
$content = preg_replace('#[color=([^-]+)-(.*)[/color]#Uis', '$2', $content);
This is simply to parse bbcode color tag, e.g. [color=red]text[/color]
Please help.
|
|
|
|
|
Hi
using System;
using System.Text.RegularExpressions;
public class Testy
{
public static void Main()
{
string input="This is a [color=red]red[/color] color and this is a [color=blue]blue[/color] color.";
string regex=@"\[color=[^\]]*?\](.*?)\[/color\]";
string output=Regex.Replace(input,regex,"$1");
Console.WriteLine(output);
}
}
There was a couple of things wrong with the regex. The original was greedy, and is now lazy. Also some escaping of ']' and '[' was needed.
Graham
-- modified at 14:41 Monday 26th June, 2006
|
|
|
|
|
Thanks a lot but what if I want to change the brakets type, say:
-color=red- text text -color!-
How can I parse it to:
<font color="red"> text text </font>
|
|
|
|
|
string regex=@"\[color=([^\]]*?)\](.*?)\[/color\]";
string replace=@"<color=$1>$2</color>";
string output=Regex.Replace(input,regex,replace);
If you are intending to place bbcode for a certain number of tags, it might be easier to use a generic regex.
-- modified at 17:58 Monday 26th June, 2006
|
|
|
|