|
hi,
Let me how to include the mdac_typ.exe in my project .msi file.How to include so that when i deliver my project setup it automatically installs the data components.
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
you need to put mdac_typ.exe in C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard\Redist>
|
|
|
|
|
I mean to disable the NIC(Network Interface Card) by running a VB program. And then enabling the card. This will make the changes of parameters in network take effect without reboot the system. I want to get it work through a program.
Thanks for reading and replying.
|
|
|
|
|
Hi,
That is best done thru WMI (Windows Management Instrumentation). But, not all changes made will be applied when you disable and then re-enable the card. You'll know this when you call a function to make a change and the return code is something like REBOOT_REQUIRED.
You can start with the System.Management and System.Management.Instrumentation namespace in VB.NET or the WMI SDK on MSDN[^].
RageInTheMachine9532
|
|
|
|
|
Hi
I have been trying to find a way to do this thru WMI but do not see any methods and all properties are read only. Can you point me in the right direction I am using Win32_NetworkAdapter I searched others and am unable to find a way to do it.
Any help is appreciated.
Thanks
Tom
|
|
|
|
|
Unfortunately, the WMI functionality that is exposed doesn't work. The idea is to get the ServiceName from the NetworkAdapter object. Then use the StopService method of the ServiceName object to stop the driver. But, alas, the driver won't stop or pause.
Apparently it can't be done through WMI. But it could be done thru calls to the PnP Device Manager. You would have to call IoGetDeviceInterfaces with the class GUID of the network adapter class to get a linked list of SymbolicLinks. Once you find the Symbolic Link name, you can pass that to IoSetDeviceInterfaceState with the Enabled param set to False.
I haven't tried to do this, and frankly, don't have to the time to write any code for it. But after about an hour of research, this is the only method I can come up with to disable/enable a NIC through code. I THINK it's the same method used by the Device Manager when you disable/enable a device through there.
RageInTheMachine9532
|
|
|
|
|
Thanks for the quick response. I will look into the solution you mentioned. Also I found this KB http://support.microsoft.com/?kbid=311272 it is a command line utility of the device manager which I may use as a last resort.
Once again thanks.
Tom
|
|
|
|
|
DevCon is a pretty neat little tool. The source code for it can be found in the Windows XP DDK. You can find how to disable and enable devices in there. Although it's written in C++, you can use the technique in a VB.NET app. But it will take a bit of effort to get the structures defined properly and P/Invoke the calls required.
RageInTheMachine9532
|
|
|
|
|
Thanks I order the XP DDK on CD to take a look and possibly generate a better solution than using the Devcon.exe program.
In the meantime I did get this to work, its not complete but it seems to work. Of course it relies on WMI and the Devcon executable.
Thanks for your help
Tom
Private Sub ChangeAdapterStatus(ByVal mAdapter As String, ByVal mStatus As String)
Dim oMngt As New ManagementScope("\\.") ' local machine
Dim oMs As New System.Management.ObjectQuery
Dim oSearch As New ManagementObjectSearcher
Dim oColl As ManagementObjectCollection
Dim oRcd As New ManagementObject
Dim oNic As PropertyData
Dim oState As String
Dim ret As Integer
'
Try
oMs.QueryString() = "SELECT NetConnectionID, NetConnectionStatus, PNPDeviceID" & _
" FROM Win32_NetworkAdapter" & _
" Where NetConnectionID = '" & mAdapter & "'"
' " Where NetConnectionID like '%'" This returns all configed adpt
oSearch.Scope = oMngt
oSearch.Query = oMs
oColl = oSearch.Get
For Each oRcd In oColl
oNic = oRcd.Properties.Item("PNPDeviceID")
Dim oDevHld As String = oNic.Value
Dim oDevID() As String = oDevHld.Split("&")
Dim oCmd As String = "\devcon.exe " & mStatus & " *" & oDevID(1) & "* updateni"
ret = Shell(Application.StartupPath & oCmd)
Next
Catch ex As ManagementException
MsgBox(ex.Message)
End Try
End Sub
Tom
|
|
|
|
|
That'll work. The only down side is DevCon is NOT redistributable. Microsoft is a bit picky about sending developer tools out with licensed products.
RageInTheMachine9532
|
|
|
|
|
I'm a newbie at programming. I need to build an Client/Server application in which my home computer is likely to be the server but possibly the school server. At most there will be no more than 200 clients of which only a few will be accessing the server at anyone time. I've heard lots about XML and ASP.Net but know nothing about them. Does VB.Net have a simple thing to use like C++'s Winsock?? What would be suitable approach use for the network communcation side of this. oh yea, the data will be being transferred over the internet to the users home systems.
Cheers
Thanks in advance
Jace
|
|
|
|
|
Without knowing much about this I suggest you look at the System.Net namespace. You can use FileWebRequest and FileWebResponse to send files back and forth. There are tons of docs on these features.
|
|
|
|
|
What is the expected use case for someone interacting with the system? Is it a scenario in which a client is supposed to transfer file(s) from client to server, or is the user interacting with a user interface, entering information into a database? Is it going to be deployed as a browser-based application or as a rich-client application? It all depends really on the function of the system and how people will use it.
|
|
|
|
|
xtremean wrote (via email):
i...need to be able send text strings, .jpg and .bmp file
types
OK, so this might not be the simplest solution for a "newbie".... that being said, here's what I would imagine doing if I were writing a custom application to do this kind of thing:
On the client side you'll have some kind of form, possibly attached to a NotifyIcon (for ease of use, like an IM client) that allows the user to select a file (or files). Using the File and FileStream you open up the client file, establish a NetworkStream connection to the server using TcpClient and TcpListener and use NetworkStream and FileStream on the server side to read the stream and write it to a file. The server is going to listen on several ports for several incoming connections, each connection a TcpListener running on its own thread, so there would be the need to start each on its own, using Asynchronous callbacks and the IAsyncResult interface. At a network level, if it is over the Internet, you might consider a establishing a VPN connection between the client location and the server location, which should protect and encrypt the transfers and prevent having to write code dealing with that aspect of things.
Then again, you could establish an FTP site somewhere and get WS_FTP Pro, or something, and enable people to upload to the FTP site. This can even use SSL for encryption, protecting the confidentiality of the information being passed.
|
|
|
|
|
Can anybody help with this question?
How can I display records in the datagrid from two tables using dataadapter and dataset?
After I change the contents of the datagrid, how can I update two tables?
I really appreciate if somebody can help me. Thanks.
|
|
|
|
|
How i can get the address of HTTP from HTTP Proxy when browse some web site. It's like ZoneAlarm's Web filtering. Can you show me the sample or some infors
Nothing
|
|
|
|
|
System.Uri has a lot of things that can be used to disect a given http request. But a proxy itself is supposed to be somewhat transparent. A request to http://www.codeproject.com should respond the same by direct connect or proxy. The only difference is that the proxy is making the request on your behalf.
I guess I don't see way to answer your question. You are asking what is the http that comes out of the proxy? You can always watch the packets come out of the proxy. Or you can lookup on wikipedia the SOCKS 4 and 5 behavior. There is no code per se because there is nothing on your internal machine can monitor about the other machine's external interface.
|
|
|
|
|
What are the basic differences between VB.NET and Visual C#.Net. What are the advantages of knowing either of them? Where is the need to know both of them? I have just began VB.Net and is so much fun, but am tempted to stretch to C#, well time is the limit, but , is there a distinct need to know C# ot C++ when you know VB.Net?
|
|
|
|
|
if you work with VB.NET .. don't learn C#
this will be a waste of time
the basic differnce is the syntax .. If you love the vb syntax more ,, then you should use vb.net and vice versa
|
|
|
|
|
It doesn't hurt to know both. Knowing both makes you more marketable. You will find that the language of choice for any given company is usually set by someone else. So in knowing both... if you apply for a position doing .NET development it doesn't matter whether they use C# or VB.
Just my two cents...
Dan Morris
|
|
|
|
|
My $0.02:
If you're gonna be working with Microsoft Office (i.e. Automation), choose VB. I find that it is MUCH easier using VB than C#.
I like C# as I find more samples and help with C# than VB, however there's not much difference between C# and VB, though the VB Editor from MS is more quirky than the C# one.
I recommend you to learn both, as they are very similar and there are times when you want to create several projects in one solution written in different languages because it is easier to write some things in VB than C# and vice versa.
|
|
|
|
|
If it were me, then I'd defiately learn BOTH - and any other langs you can - no defeloper can get away with knowing only one language these days and still survive!
Another thing to look at would be which areas of the .NET framework particularly interest you - security / graphics / web. If you like a particular area, then maybe specialise in that area, but from all languages - security is always a particularly hot area, and pays real well.
The only caveat would be if you do settle on VB, then prepare yourself for lots of flak from C# / C / C++ devs for using a "kiddy language", or a "language for middle managers" etc....language snobbery is generally pointed at VB more than most lol
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
RichardGrimmer wrote:
The only caveat would be if you do settle on VB, then prepare yourself for lots of flak from C# / C / C++ devs for using a "kiddy language", or a "language for middle managers" etc....language snobbery is generally pointed at VB more than most lol
Hmm, are you thinking of any developers in particular?
Steve S
|
|
|
|
|
I'm trying to open a file of any type from an app built with VB6.
Does anybody know the code to open a file, so that the program associated with this file type starts?
[Maybe it's a stupid question, but i just don't know how to do this ]
Thanks in advance,
M_M_G
|
|
|
|
|
Short of shelling out and running "Start (the name of the file)" there are other api ways.
Tak a look here vbnet.mvps.org
|
|
|
|