|
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
|
|
|
|
|
Thx for your reply, but could you give a code example?
|
|
|
|
|
I always use ShellExecute:
<br />
'ShellExecute<br />
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _<br />
(ByVal hwnd As Long, ByVal lpOperation As String, _<br />
ByVal lpFile As String, ByVal lpParameters As String, _<br />
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long<br />
<br />
Public Const SW_NORMAL = 1 ' Displays the window normalised<br />
Public Const SW_SHOWMINIMIZED = 2 ' Displays the window minimised<br />
Public Const SW_SHOWMAXIMIZED = 3 ' Displays the window maximised<br />
Public Const SW_SHOWNOACTIVATE = 4 ' Displays the window normalised without focus<br />
Public Const SW_SHOW = 5 ' Activates a window at its current size<br />
Public Const SW_SHOWNA = 8 ' Displays the window at its current size without focus<br />
Public Const SW_SHOWDEFAULT = 10 ' Displays the window at its default size<br />
<br />
ShellExecute Me.hwnd, "Open", m_strFilename, "", "", SW_SHOWMAXIMIZED<br />
That should do everything you need!
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Many thanks!
The code is working great (with a few mods)!
|
|
|
|
|
M_M_G wrote:
with a few mods
What did you have to change? (Not having a dig, just curious!)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
All the 'Public' stuff didn't work.
It also didn't work properly with the 'SW_SHOWMAXIMIZED' argument.
|
|
|
|
|
The 'Public' stuff works if you have the code fragment in a global BAS module, not inside a FRM file, AFAIR.
Not all apps honour the SW_SHOW* flags, and it is optional.
Steve S
|
|
|
|
|
Hi everyone i am new to this, I am a final yr student studying software engineering in my final year in the UK. For my final project I am doing a training program to teach beginners the basic of Word it will be in two lanuages English and Vietnamese. I have decided to use VB.NET to program, it is my first time using it.
Can any one give me help me on using (embedding into your exe) icons on your menu part, different languages if Vietnamese is an option for VB.NET. And what format should i use as files for forms to load up, for example if the forms loaded the help files as html etc. I having trouble cause my designed tutorials have pictures and text, i do not know how to get the forms to laod it or can someone suggest a suitable way around it. It will be a menu driven GUI based program.
|
|
|
|
|
Put aan imagelist control on your form and put the images inside the imagelist. You can use png, gif or jpeg. One thing the image size is limited so don't make the images too big.
|
|
|
|