Sunday, September 18, 2011

Sunday 9.18.11

Imports System
Imports System.Linq
Imports System.Diagnostics

Namespace Apress.VisualBasicRecipes.Chapter06
Public Class Recipe06_01

Public Shared Sub Main()
'build the query to return information for all
'processes running on the current machine. The data will be returned
'as instances of the Process class

Dim procsQuery = From proc In Process.GetProcesses

'run the query generated earlier and iterate
'through the results
For Each proc In procsQuery
Console.WriteLine(proc.ProcessName)
Next
'wait to continue
Console.ReadLine()
End Sub
End Class
End Namespace


Imports System
Imports System.Linq
Imports System.Diagnostics

Namespace Apress.VisualBasicRecipes.Chapter06
Public Class Recipe06_03

Public Shared Sub Main()

'Buil the query to return inforamation for all processes
'running on the current machine
'the data will be returned in the form of anonymous
'types with ID, name, and MemUsed properties

Dim procInfoQuery = From proc In Process.GetProcesses Select proc.Id, Name = proc.ProcessName, _
MemUsed = proc.WorkingSet64
'run the query generated earlier and iterate through the results
For Each proc In procInfoQuery
Console.WriteLine("[{0,5}], {1, -20} - {2}", proc.Id, proc.Name, proc.MemUsed)
Next

'wait to continue
Console.ReadLine()
End Sub
End Class
End Namespace


public partial class RadioButtonDemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void grpSize_CheckedChanged(object sender, EventArgs e)
{
if (rdoSize10.Checked)
{
lblTime.Font.Size = 10;
}
else if (rdoSize14.Checked)
{
lblTime.Font.Size = 14;
}
else
{
lblTime.Font.Size = 16;
}
}

protected void lblTime_Init(object sender, EventArgs e)
{
lblTime.Font.Name = "Verdana";
lblTime.Font.Size = 20;
lblTime.Font.Bold = true;
lblTime.Font.Italic = true;
lblTime.Text = DateTime.Now.ToString();
}
}


No comments: