Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
AnswerRe: when thread.sleep() called the visibility of the label is not working properly. Pin
Luc Pattyn26-Feb-11 5:06
sitebuilderLuc Pattyn26-Feb-11 5:06 
QuestionCompact PST File in Outlook Pin
pravin_mun25-Feb-11 21:58
pravin_mun25-Feb-11 21:58 
AnswerRe: Compact PST File in Outlook Pin
N a v a n e e t h26-Feb-11 14:41
N a v a n e e t h26-Feb-11 14:41 
Questionwhich mobile supports AT commands for sending sms through coding in c# Pin
aeman25-Feb-11 21:20
aeman25-Feb-11 21:20 
AnswerRe: which mobile supports AT commands for sending sms through coding in c# Pin
OriginalGriff25-Feb-11 21:24
mveOriginalGriff25-Feb-11 21:24 
GeneralRe: which mobile supports AT commands for sending sms through coding in c# Pin
aeman25-Feb-11 22:05
aeman25-Feb-11 22:05 
QuestionConvert into Url from Socket Pin
Anubhava Dimri25-Feb-11 18:35
Anubhava Dimri25-Feb-11 18:35 
AnswerRe: Convert into Url from Socket Pin
OriginalGriff25-Feb-11 20:39
mveOriginalGriff25-Feb-11 20:39 
I'm not sure I understand you fully: your are receiving data from a socket, and you want to extract a URL from it?

What does the data contain?
There are Regexes which will extract URL's from strings, but it may not work, depending on what you string holds.
For example:
//  using System.Text.RegularExpressions;

/// <summary>
///  Regular expression built for C# on: Sat, Feb 26, 2011, 07:38:05 AM
///  Using Expresso Version: 3.0.3634, http://www.ultrapico.com
///  
///  A description of the regular expression:
///  
///  [Protocol]: A named capture group. [\w+]
///      Alphanumeric, one or more repetitions
///  :\/\/
///      :
///      Literal /
///      Literal /
///  [Domain]: A named capture group. [[\w@][\w.:@]+]
///      [\w@][\w.:@]+
///          Any character in this class: [\w@]
///          Any character in this class: [\w.:@], one or more repetitions
///  Literal /, zero or one repetitions
///  Any character in this class: [\w\.?=%&=\-@/$,], any number of repetitions
///  
///
/// </summary>
public static Regex regex = new Regex(
      "(?<Protocol>\\w+):\\/\\/(?<Domain>[\\w@][\\w.:@]+)\\/?[\\w\\."+
      "?=%&=\\-@/$,]*",
    RegexOptions.IgnoreCase
    | RegexOptions.CultureInvariant
    | RegexOptions.IgnorePatternWhitespace
    | RegexOptions.Compiled
    );


// This is the replacement string
public static string regexReplace = 
      "<Hello>";


//// Replace the matched text in the InputText using the replacement pattern
// string result = regex.Replace(InputText,regexReplace);

//// Split the InputText wherever the regex matches
// string[] results = regex.Split(InputText);

//// Capture the first Match, if any, in the InputText
// Match m = regex.Match(InputText);

//// Capture all Matches in the InputText
// MatchCollection ms = regex.Matches(InputText);

//// Test to see if there is a match in the InputText
// bool IsMatch = regex.IsMatch(InputText);

//// Get the names of all the named and numbered capture groups
// string[] GroupNames = regex.GetGroupNames();

//// Get the numbers of all the named and numbered capture groups
// int[] GroupNumbers = regex.GetGroupNumbers();


If this doesn't help, we will need more information
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

GeneralRe: Convert into Url from Socket Pin
Anubhava Dimri25-Feb-11 21:08
Anubhava Dimri25-Feb-11 21:08 
GeneralRe: Convert into Url from Socket Pin
OriginalGriff25-Feb-11 21:22
mveOriginalGriff25-Feb-11 21:22 
GeneralRe: Convert into Url from Socket Pin
Anubhava Dimri25-Feb-11 21:29
Anubhava Dimri25-Feb-11 21:29 
GeneralRe: Convert into Url from Socket Pin
OriginalGriff25-Feb-11 21:33
mveOriginalGriff25-Feb-11 21:33 
GeneralRe: Convert into Url from Socket Pin
Anubhava Dimri25-Feb-11 23:04
Anubhava Dimri25-Feb-11 23:04 
GeneralRe: Convert into Url from Socket Pin
OriginalGriff25-Feb-11 23:23
mveOriginalGriff25-Feb-11 23:23 
GeneralRe: Convert into Url from Socket Pin
Anubhava Dimri26-Feb-11 1:53
Anubhava Dimri26-Feb-11 1:53 
GeneralRe: Convert into Url from Socket Pin
OriginalGriff26-Feb-11 2:00
mveOriginalGriff26-Feb-11 2:00 
GeneralRe: Convert into Url from Socket Pin
Anubhava Dimri27-Feb-11 17:18
Anubhava Dimri27-Feb-11 17:18 
Questionkeyword "dynamic" - real world applications? Pin
devvvy25-Feb-11 17:23
devvvy25-Feb-11 17:23 
AnswerRe: keyword "dynamic" - real world applications? Pin
SledgeHammer0125-Feb-11 17:50
SledgeHammer0125-Feb-11 17:50 
AnswerRe: keyword "dynamic" - real world applications? Pin
i.j.russell26-Feb-11 10:32
i.j.russell26-Feb-11 10:32 
QuestionRecursive Permutation Generator. Pin
shivamkalra25-Feb-11 13:37
shivamkalra25-Feb-11 13:37 
AnswerRe: Recursive Permutation Generator. Pin
PIEBALDconsult25-Feb-11 14:53
mvePIEBALDconsult25-Feb-11 14:53 
GeneralRe: Recursive Permutation Generator. Pin
Luc Pattyn25-Feb-11 15:01
sitebuilderLuc Pattyn25-Feb-11 15:01 
GeneralRe: Recursive Permutation Generator. Pin
PIEBALDconsult28-Feb-11 1:46
mvePIEBALDconsult28-Feb-11 1:46 
GeneralRe: Recursive Permutation Generator. Pin
shivamkalra25-Feb-11 16:47
shivamkalra25-Feb-11 16:47 

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.