Jump to content
Xtreme .Net Talk

CarlEOgden

Members
  • Posts

    8
  • Joined

  • Last visited

About CarlEOgden

  • Birthday 07/24/1967

Personal Information

  • Visual Studio .NET Version
    VB.NET Standard
  • .NET Preferred Language
    VB.NET

CarlEOgden's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, Did you ever sort this out? Cheers, Carl.
  2. Hi, Can anyone help me in converting this VB code to .NET ? I need to access the Terminal Services API and haven't worked out how to do the following:- Public Declare Function WTSOpenServerA Lib "wtsapi32.dll" ( _ ByVal pServerName As String) As Long Public Declare Function WTSCloseServer Lib "wtsapi32.dll" ( _ ByVal hServer As Long) As Long Public Declare Function WTSEnumerateSessions _ Lib "wtsapi32.dll" Alias "WTSEnumerateSessionsA" ( _ ByVal hServer As Long, ByVal Reserved As Long, _ ByVal Version As Long, ByRef ppSessionInfo As Long, _ ByRef pCount As Long _ ) As Long Public Declare Function WTSQuerySessionInformation Lib "wtsapi32.dll" _ Alias "WTSQuerySessionInformationA" (ByVal hServer As Long, _ ByVal SessionID As Long, ByVal WTS_INFO_CLASS As WTSInfoClass, _ ByRef QSbuffer As Long, ByRef pCount As Long) As Long Public Declare Sub WTSFreeMemory Lib "wtsapi32.dll" ( _ ByVal pMemory As Long) Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _ Destination As Any, Source As Any, ByVal Length As Long) Public Declare Function lstrlenA Lib "kernel32" ( _ ByVal lpString As String) As Long Public Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" ( _ ByVal lpString1 As String, ByVal lpString2 As Long) As Long Thanks for any help given. Cheers, Carl.
  3. Hi, Thanks for that, it's a bit ovbious! I'll try to open my eyes and read the drop down boxes better or read my book! Cheers, Carl.
  4. Hi, I've got the following code in the KeyPressed function of a Text Box:- Dim KeyAscii As Integer KeyAscii = Asc(e.KeyChar) If KeyAscii = Asc(ControlChars.Cr) Then Button1.Focus() e.Handled = True Me.Button1_Click() Exit Sub End If Me.Button1_Click() does work! What do I need so that when I press enter after entering some text to then execute the code in button1. Thanks for any and all help given. Carl.
  5. Hi, Sorry for the delay, any how! Create a new project, add a DataGrid and a button. Put the following code in the button:- <<<< Start Code >>>> Dim MyDataSet As New DataSet("MyDataSet") Dim MyDataTable As New DataTable("MyDataTable") DataGrid1.ColumnHeadersVisible = True DataGrid1.DataSource = MyDataTable MyDataTable.Columns.Add("User ID") MyDataTable.Columns.Add("User Name") MyDataTable.Columns.Add("Location") Dim NewRow As DataRow = MyDataTable.NewRow NewRow(0) = "CEO" NewRow(1) = "Carl E. Ogden" NewRow(2) = "Manchester, England" MyDataTable.Rows.Add(NewRow) <<<< End of Code >>>> I know this is really simple but it works and you'll be able to adapt it to your requirements! I'd recommend making the grid read only, this stops users from editing the grid direct and then do what you need to so that you can alter the data. Hope this helps, Carl.
  6. Hi, I'll dig out my code (it's on my laptop and not my works machine) and post them here for you! I hacked it from a C example but got it working and it looks "ok"! As long as you make the grid read only! Cheers, Carl.
  7. Hi, What a pain this is! You need to create a new datasource, datatable and then link the datagrid to that and then add your columns and data. If you make the grid read only, that stops users adding rows. If you need samples, I can post some tonight? Cheers, Carl.
  8. Hi, I'm trying to write a program that gets the users that are logged onto a Terminal Services Server. A bit like the "tsadmin.exe" program. But I need to log some stats! I would like to know how to add in this API call but am new to VB.NET and don't know how to! WTSRegisterSessionNotification It's URL for information is:- http://msdn.microsoft.com/library/default.asp?url=/libr... When this call is working, you need to then watches using WM_WTSSESSION_CHANGE and HandlerEx, I presume that I need some timer control and check for this getting results but haven't found any Google link that helps me! WM_WTSSESSION_CHANGE URL is:- http://msdn.microsoft.com/library/default.asp?url=/libr... HandlerEx URL is:- http://msdn.microsoft.com/library/default.asp?url=/libr... Many thanks in advance for any and all help given. Cheers, Carl.
×
×
  • Create New...