System.Windows.Forms.Clipboard.GetText C# (CSharp) Method

GetText() public static method

public static GetText ( ) : string
return string
		public static string GetText ()
		{
			return GetText (TextDataFormat.UnicodeText);
		}
		

Same methods

Clipboard::GetText ( TextDataFormat format ) : string

Usage Example

Example #1
0
 public static string GetClipBoardData()
 {
     try
     {
         string    ClipData  = null;
         Exception e         = null;
         Thread    staThread = new Thread(
             delegate()
         {
             try
             {
                 ClipData = Clipboard.GetText(TextDataFormat.Text);
             }
             catch (Exception ex)
             { e = ex; }
         });
         staThread.SetApartmentState(ApartmentState.STA);
         staThread.Start();
         staThread.Join();
         return(ClipData);
     }
     catch (Exception)
     {
         return(string.Empty);
     }
 }
All Usage Examples Of System.Windows.Forms.Clipboard::GetText