<asp:GridView ID="grd_Specs" CssClass="footable" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="item1" HeaderText="Pc Specs" />
<asp:BoundField DataField="itemstat" HeaderText="" />
</Columns>
</asp:GridView>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
PopulatePCGrid()
End Sub
Dim DT As New DataTable
Dim DR As DataRow
Private Sub PopulatePCGrid()
Dim DS As New DataSet
DT = New DataTable("items")
DT.Columns.Add("item1")
DT.Columns.Add("itemstat")
DR = DT.NewRow
AddRowToGrid("Operating System", My.Computer.Info.OSFullName.ToString)
DR = DT.NewRow
AddRowToGrid("Total Memory", ((My.Computer.Info.TotalPhysicalMemory / 1024) / 1024).ToString("N0") & " MB")
grd_Specs.DataSource = DT
grd_Specs.DataBind()
End Sub
Private Sub AddRowToGrid(ByVal description As String, ByVal data As Object)
With DR
.Item("item1") = description
.Item("itemstat") = data
End With
DT.Rows.Add(DR)
End Sub
<asp:GridView ID="grd_Specs" CssClass="footable" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="item1" HeaderText="Pc Specs" />
<asp:BoundField DataField="itemstat" HeaderText="" />
</Columns>
</asp:GridView>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
PopulatePCGrid()
End Sub
Dim DT As New DataTable
Dim DR As DataRow
Private Sub PopulatePCGrid()
Dim DS As New DataSet
DT = New DataTable("items")
DT.Columns.Add("item1")
DT.Columns.Add("itemstat")
DR = DT.NewRow
AddRowToGrid("Operating System", My.Computer.Info.OSFullName.ToString)
DR = DT.NewRow
AddRowToGrid("Total Memory", ((My.Computer.Info.TotalPhysicalMemory / 1024) / 1024).ToString("N0") & " MB")
grd_Specs.DataSource = DT
grd_Specs.DataBind()
End Sub
Private Sub AddRowToGrid(ByVal description As String, ByVal data As Object)
With DR
.Item("item1") = description
.Item("itemstat") = data
End With
DT.Rows.Add(DR)
End Sub
Copyright © 2024, NextGenUpdate.
All Rights Reserved.