I have been using a simple web form application for url shortening in asp.net. I have sucessfully made my function and when i change the url it should automatically copies to clipboard.I have made the text value to store in variable like \[code\] shortUrl.Text = shortURL; \[/code\]After this i am calling the Clipboard function\[code\] clip_board(shortURL);\[/code\]My function is\[code\] public void clip_board(string shortUrl) { MessageBox.Show(shortUrl); Clipboard.SetText(shortUrl); }\[/code\]Here the message box shows the shorten url but the \[code\]Clipboard.SetText()\[/code\] showing error as\[quote\] Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.\[/quote\]How to overcome this error?