The cursor is part of the drawing namespace. To display a specific cursor, you can refer to the document for all available types. To display the wait cursor, try the following code:
Use the System.Diagnostics.Process class to start and stop system processes. The GetProcesses function returns all the processes that are running on the machine, and it has two definitions, one for the local machine and the other for the remote machine.
If you want to get the running process on the local machine, use getprocesses (), otherwise use GetProcesses (string machinename):
public static process[] GetProcesses ();
public static process[] GetProcesses (string);
Like what:
process[] proclist = new process[100];
ProcList = Process.getprocesses ();
for (int i=0; i<20; i++)
{
string strprocname = Proclist.processname;
int iprocid = proclist.id;;
}
Do not forget to refer to system.diagnostic and write the following line of code in the Using list:
Using System.Diagnostics;
By using the method of the Process class, we can even start, stop, or cancel a process.
How do I open the browser in my application?
Use the System.Diagnostics.Process class to start and stop a program, which can be used to start an EXE file. For example, if you want to open a URL in a browser, you can pass the URL as a parameter to the start function:
You can use the PlaySound API to play a WAV file. Use Sysimport to introduce a DLL and define the API as global before using it. Take a look at the code that invokes the API below:
[Sysimport (dll= "Winmm.dll")]
public static extern long PlaySound (String lpszname, long hmodule, long dwflags);
................
PlaySound (szwavfilename, 0, 0);
How do I send a message in C #?
To implement the ability to send messages in C #, the tool you need to use is Visual C #. NET, which involves System.Web.Util and a System.Web.dll collection.
Specifically, we can use the SmtpMail class to send messages in a C # application. By default, messages are queued in the system to ensure that the caller does not cause network congestion. The SmtpMail class is defined in the System.Web.Util namespace. Before using smtpmail, you need to call the
Using System.Web.Util
There is only one member function send in this class. It is responsible for sending an email message, whether a MailMessage class or 4 parameter variables can be passed to the Send function. There are two forms of calling the Send function:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.