|
You can use for each or array notation to get objects out of an arraylist. If you're using VB.NET 2.0, do not use arraylist, use the generic versions instead.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sir/Madam,
I wanted to know something about the registry.As the executiable files of the machine resides into the registry.
Now My Question is , eg there is Yahoo Messanger installed on my machine.
What keysin the registry allows the user to open the yahoo messanger.I mean , Administrator can prevent the user to stop openning a particular exe.
Likewise what are the keys involved in the registry that prevent the user to stop openning the yahoo messenger.
Thanks and Regards
Pankaj Garg
|
|
|
|
|
Try installing Yahoo Messenger at your own computer and search the registery yourself? You can open the registery editor by using Start --> Run --> regedit
--Zaegra--
|
|
|
|
|
amaneet wrote: As the executiable files of the machine resides into the registry
I think you've asked this question before...
.EXE's are NOT stored in the registry. Indexes to COM components, which are supplied to certain .EXE's and .DLL's, are stored there.
amaneet wrote: What keysin the registry allows the user to open the yahoo messanger
There are no keys that allow this.
amaneet wrote: Administrator can prevent the user to stop openning a particular exe.
This is controlled by Group Policy. Pickup a copy of the Windows XP or Windows Server 2003 Resource Kit to learn more about it.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
how can i determine if a program is currently runing and then switch to it in VB 2005?
I am always greteful for any help!
|
|
|
|
|
if u please elaborate it more precisely.
Thanks
|
|
|
|
|
I've used the FindWindow function but this only works if I send the full window title to it. I want to find if a current program is running and if true then switch focus to this window.
I am always greteful for any help!
|
|
|
|
|
Sir,
Provide the code.This will help me in manipulating it.
Thanks
|
|
|
|
|
I use this function to find if a window is currently runing. This is declared in genearl declarations:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
This function returns a value greater than 0 if window is found. I have to send the full window title to this function to return a value greater than 0.
What I want to knowl is there someway I can find a window title that is currently runing and if ture then switch the focus to this program?
I have used the AppActive() function with the Shell function but I need to be able to switch to a running program(s) by passing only a part window title name.
I am always greteful for any help!
|
|
|
|
|
GuildfordG wrote: but I need to be able to switch to a running program(s) by passing only a part window title name.
You'll have to enumerate through all the windows and compare the window titles yourself. There is no function to do a "search" for a title.
EnumWindows[^] docs
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Sir/Madam,
I wanted to import System.Management
Will it take any reference to add system.Management in the code behind file
The problem is , if i am trying to write imports System.Management explicitly then i am not getting the management class.
Please help.
Thanks and Regards
Pankaj Garg
|
|
|
|
|
Yes, you have to add a Reference to the System.Management.dll. It contains the entire System.Management namespace.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
hi all,
I want to ask one question about time processing in vb.net. I have 1 button and i want to caculate the time between the first click on that button and the second.
thanks.
|
|
|
|
|
Store the time of the first click and subtract it from the time of the second. DateTime.Now is what you need.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
try the date.subtract function
|
|
|
|
|
Hi!
I have a DataList which pulls info from the database and assigns the values into the labels. Now each row also includes a button, and I try to assign the text value to the buttons from the labels text, but I can't get it to work.
Here is the code I got:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Integer = 0 To DataList1.Items.Count - 1
Dim linktext As String
linktext = (CType(Me.DataList1.Items(i).FindControl("materialLabel"), Label).Text)
CType(Me.DataList1.Items(i).FindControl("LinkButton"), LinkButton).Text = linktext
Next
End Sub
|
|
|
|
|
What happens when you step through the code ? Does it crash, or do nothing ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It's doing nothing. It assigns the right values to the name labels which it pulls from database but nothing to the buttons.
I could assign the value via:
<%# 'Text=Eval(data)' %>
but I still will have to loop through the buttons as they need to send different values to the session object as clicked which are needed on the next site to which they redirect.
Otherwise I would have to create every time a LinkButton_onClicked handler for each button.
(FYI: I just started coding with .net 2 weeks ago)
|
|
|
|
|
TAK78 wrote: (FYI: I just started coding with .net 2 weeks ago)
I"m assuming you had extensive coding experience before this then ?
What happens if you check the value of the text on the button after you assign it ? I'm wondering if CType makes a copy ? I don't know, I'm just guessing.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Used to code in ActionScript for about 3 years, but still have trouble with syntax in .NET.
Well actual code needs to be:
text='<%# Eval("data") %>' //sorry for that
Here is the code to check if any value was assigned to the button:
For i As Integer = 0 To DataList1.Items.Count - 1
Dim linktext As String
linktext = (CType(Me.DataList1.Items(i).FindControl("materialLabel"), Label).Text)
CType(Me.DataList1.Items(i).FindControl("LinkButton"), LinkButton).Text = linktext
Dim buttonString As String
buttonString = CType(Me.DataList1.Items(i).FindControl("LinkButton"), LinkButton).Text
txtLabel.Text = buttonString
Next
It will display the value of the last button in txtLabel, which would mean that it got assigned the value, but why want it display than?
|
|
|
|
|
If you step through the debugger then I would assume you're going to see the same result. That is what you should do to check, however.
Where is the data coming from ? Where is this code called ? Is it possible that you rebind to your data source after this code runs ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The data is pulled from the database. Which makes its selection for the row through the variable data it gets from the session:
Session("data") = "B" 'selects all "B" like rows in database
Works fine on my material label as I use:
<asp:Label ID="materialLabel" runat="server" text='<%# Eval("material") %>'></asp:Label>
The code for the buttons however is called on the Page_Load, where I use the loop.
I will need a loop for the buttons because I need to assign a new Session value for each one after they are pressed, as they will redirect to a new page which will display the information of the selected material.
And it wouldn't be efficient to create a LinkButton_Click handler for each one, as some pages may have 10 or more buttons.
I also checked now in Debug and the buttons actually get assigned the right value, but it want display on the buttons on the site.
If you know another or better solution let me know.
Thanks for your efforts by the way!
-- modified at 21:31 Tuesday 10th April, 2007
|
|
|
|
|
TAK78 wrote: The data is pulled from the database.
Where ?
TAK78 wrote: The code for the buttons however is called on the Page_Load, where I use the loop.
OK, if you read from the DB in page prerender or an event, then that code will run after and replace your data.
TAK78 wrote: I will need a loop for the buttons because I need to assign a new Session value for each one after they are pressed,
Why do you need to use session state at all ?
TAK78 wrote: And it wouldn't be efficient to create a LinkButton_Click handler for each one, as some pages may have 10 or more buttons.
You should create one click event handler and have it check which button has been pressed, not create an event for each button.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I am looking to create a program where you can schedule a persons time by jobs. These jobs may take 1 hour to 10 hours. I would like to be able to use it like a gantt chart where I have a list of jobs and I can add them to each persons timeline.
OR If someone could point me in the direction of how to do this I would be most appreciative.
Thanks for all the help
NewbieDave
|
|
|
|
|
If you may remember I had created a HTA that unlocks computers on our network. The HTA works great. No issues from any of the department managers that use it. It drives me crazy though. I don't think it's clean enough. to be able to use it I have to put the HTA and several batch files and several script files on the machine in a folder. Is it possible to convert the HTA, batch, and script files into a program that I could run an installer with and possibly an updater? Not only would it make the whole project cleaner, but it would add security to the program since it would keep the code out of reach.
So back to the question, is it possible?
Zach
|
|
|
|