|
You can use the remote computer NetBIOS name or IP address for 'strComputer'.
If you want to run the code under different credentials, you need to use SWbemLocator:
strComputer = "192.168.1.12"
strUser = "username"
strPassword = "password"
Set objLocator = CreateObject("WBemScripting.SWbemLocator")
Set objWMIService = objLocator.ConnectServer(strComputer, "Root\Cimv2", strUser, strPassword)
Set CompInfo = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
...
strUser needs to be an administrator account on strComputer. Firewalls can also be an issue.
|
|
|
|
|
Probably an easy question for the gang here.
I have a group box that I want to create a button at runtime. When I create the button right now, it places it 'behind' the group box instead of inside of it. How do I get the button to show up inside of the box?
Thanks in advance.
|
|
|
|
|
Nevermind, I found the answer: Me.grpQuadrant.Controls.Add(btn)
|
|
|
|
|
I have a custom control where I'd like to group a set of closely related properties. For example, look at a button control and click on the Application settings or databinding properties. There is a plus button for expanding and setting the subset properties.
How can I implement that functionality in an extended control?
Thanks!
|
|
|
|
|
|
If I am correct you will have to create a property that returns a custom made object with the properties you require. That way you can emulate the property inside a property that you describe.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I think I found the answer in inheriting from ExpandableObjectConverter.
Thanks for the help guys.
|
|
|
|
|
|
Hi Vardhan,
If you are trying to introduce yourself, my friend this is not the right place.
Vinay
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hi All
I have one application in Visual Basic.I have created one folder at runtime.I want to give permission to that folder that only administrator can access this folder,nobody can.
Is it possible in visual basic?
Second problem is:I have created runtime excel files.It works perfectly.
But problem is i want set allignment property through coding in excel file.
My code is:
Set AppXls = CreateObject("Excel.Application")
Set ObjWb = AppXls.Workbooks.Add
Set ObjWs = ObjWb.Worksheets.Add
ObjWs.Range("B1").Value = "SISTER NIVEDITA SCHOOL ON WHEELS"
ObjWs.Range("B2").Value = "SUPPORTED BY"
'ObjWs.Range("B2").Font.Bold = True
ObjWs.Range("B3").Value = "SHARE AND CARE FOUNDATION-U.S.A"
ObjWs.Range("B4").Value = "MEDICAL REPORT"
ObjWs.Range("C4").Value = Label3.Caption
ObjWs.Range("D4").Value = txt_date.Text
ObjWs.Range("B7") = Text1(0).Text
ObjWs.Range("B8") = cmb_address.Text
ObjWs.Range("B9") = Text1(2).Text
what i do?
Pls help me.
Thanks
monika
|
|
|
|
|
Hiii Monika
for the alignment in excel use the following
objws.Columns(1).HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter
May this solved your problem
Thanx
~Khatri mitesh
khatrimitesh@hotmail.com
|
|
|
|
|
|
Hi,
i coded a little app. with the chart control ZedGraph and everything is working fine.
But now i have to print the chart with a background (milimeter grid).
How can manage this, is there perhaps a code snippet in the codeproject arcive ?
I really searched but i couldn't find anything !
Or are there tuts out there covering the printing with ZedGraph ?
I really don't know what i can do ;((
Many, many thanx and best regards.
Croc
|
|
|
|
|
Have you bothered to look at the ZedGraph website?
It contains alot of documentation and even a user forum, which would be the best place to ask your question.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
is there any function in vb where you can retrieve if a specific removable drive or disk is write protected = true or false??
or any other way custom function you can retrieve its write protection state???
please...
modified on Thursday, July 24, 2008 4:30 AM
|
|
|
|
|
Maybe try writing a temporary file to the drive, if it writes it's not write-protected, if it throws an 'Access Denied' error it may be write-protected (or you don't have adequate permissions)?
|
|
|
|
|
Yup!! that's also what im thinking before.. create a temp. file if it returns permission/write protected error means false and if transaction success means true... i just got an error handling before but i've figure it out... hehe
HERE'S my sample function:
'***********start fucntion****
<br />
Private Function IsDriveWriteProtected(Byval DriveName as String) as boolean<br />
try<br />
<br />
'System.io.File.Create() statement goes here..<br />
<br />
return false<br />
catch ex as exception<br />
'if error arise? means write protected or permission to write access denied<br />
return true<br />
end try<br />
End Function<br />
'************end fucntion*******
***********Thanks to "THE JZ" ******** youre a quite good help.. and i'll mark this thread as answered in your name.. thanks again...
|
|
|
|
|
You're welcome. Glad I could help.
|
|
|
|
|
HI,
i am getting error " Word cannot fire events"
Dim oWApp As New Word.Application
oWApp.Application.Visible = True
oWApp.Application.Documents.Add()
oWApp.Selection.TypeText("Hello world")
oWApp.ActiveDocument.SaveAs("f:\vv.doc")
oWApp.Quit()
Regards,
Murali Kumar Pitchika
http://pitchika.page.tl/
http://murali.vndv.com/
Regards,
Murali Kumar Pitchika
http://muralip.f2g.net
|
|
|
|
|
Hiii
First declare object of word like this (With Events) then try.
public Withevents oWapp as new word.application
Thanx
~Khatri Mitesh
|
|
|
|
|
It took me long enough to understand the basic aspects of object orientation, like inheritance, but i still can't seem to wrap my head around what on earth an interface is or what purpose it serves. I've read all the books, and i still can't seem to get it.
if (your.Life == lifestyles.Programming)
{
your.Cool = true;
}
else
{
your.Cool = false;
}
|
|
|
|
|
Does an interface not specify the methods/functions/procedures available in the implementation section, so that you can hide the actual implementation from the users? Is it not a method of abstraction... ie: all you need to know is what to call, how to call it and what it does, you do not need to know exactly how it works.
--------------------------------------------------------
Knowledge is knowing that the tomato is a fruit.
Wisdom is not putting it in fruit salad!!
|
|
|
|
|
An interface is a "contract" that specifies what properties and methods a class must have. Interfaces are commonly used for making a program extensible. This way your program can create and use objects that implement the interface without making them inherit from a specific base class.
Another example use for interfaces is the IEnumerable interface. Anything that implements this interface can be used in for each, LINQ, and data binding. If not for interfaces, these classes would all have to inherit from the same base class. Can you imagine making Array, Stack, List, Dictionary, etc. all share a base Enumerable class?
|
|
|
|
|
Um, thanks for trying to explain it... hate to say i'm still as lost as ever. I'll think about it, see if i can't figure it out.
if (your.Life == lifestyles.Programming)
{
your.Cool = true;
}
else
{
your.Cool = false;
}
|
|
|
|
|
Gideon's answer is correct.
Let's say you want to use a specific interface and that interface has 2 subs and a function:
Public Interface ISomeInterfacehere
Sub AddUser(byval vUser as string)
Sub UpdateUsers
function GetBirthDay(byval vUser as string) as datetime
End Interface
The interface is not providing any code, its just providing method signatures that you need to implement. When you "implement the interface" in your class, you write the code for what you want each sub/function to do.
Public Class TestClass
Implements ISomeInterfacehere
Public sub AddUser(byval vUser as string) As String Implements ISomeInterfacehere.AddUser
'You would add code here to add a user
End Function
Public sub UpdateUsers Implements ISomeInterfacehere.UpdateUsers
'You would add code here to update users
End Function
Public function GetBirthDay(byval vUser as string) as datetime Implements ISomeInterfacehere.GetBirthDay
'You would add code here to return the need birth date.
End Function
End Class
I free handed the example above, but it shows how to create and use the interface.
|
|
|
|