Bueno si el win7 ya viene con el framework 2.0
, ojalá sea cierto.
Saludos.

Saludos.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
import java.io.*;
public class RegQuery {
private static final String REGQUERY_UTIL = "reg query ";
private static final String REGSTR_TOKEN = "REG_SZ";
private static final String REGDWORD_TOKEN = "REG_DWORD";
private static final String SERIAL_USB = REGQUERY_UTIL +
"HKLM\\SYSTEM\\CurrentControlSet\\Control\\DeviceClasses\\{a5dcbf10-6530-11d2-901f-00c04fb951ed}\\";
//+ " /v DeviceInstance";
public static String getSERIALS_USB() {
try {
Process process = Runtime.getRuntime().exec(SERIAL_USB);
StreamReader reader = new StreamReader(process.getInputStream());
String ret, cad[], su[];
int p = -1;
reader.start();
process.waitFor();
reader.join();
String result = reader.getResult();
cad = result.split("\n");
ret = "";
for(int i=0; i < cad.length; i++) {
p = cad[i].indexOf("USB");
if (p != -1 ) {
cad[i] = cad[i].substring(p);
su = cad[i].split("#");
ret += su[2]+"\n";
}
}
return ret;
}
catch (Exception e) {
return null;
}
}
static class StreamReader extends Thread {
private InputStream is;
private StringWriter sw;
StreamReader(InputStream is) {
this.is = is;
sw = new StringWriter();
}
public void run() {
try {
int c;
while ((c = is.read()) != -1)
sw.write(c);
}
catch (IOException e) { ; }
}
String getResult() {
return sw.toString();
}
}
public static void main(String s[]) {
System.out.println("Seriales :\n" + getSERIALS_USB());
}
}
Public Function FlashSerials() As String
Dim cad As String
Dim TGUID As GUID
Call IIDFromString(StrPtr("{53f56307-b6bf-11d0-94f2-00a0c91efb8b}"), TGUID)
Dim hDev As Long
' puntero a la clase de los USB
hDev = SetupDiGetClassDevs(TGUID, &H0, &H0, &H12)
If hDev = -1 Then Exit Function
Dim lCount As Long
Dim lSize As Long
Dim DTL As SP_DEVICE_INTERFACE_DETAIL_DATA
Dim DTA As SP_DEVICE_INTERFACE_DATA
DTA.cbSize = Len(DTA)
DTL.cbSize = &H5
lCount = &H0
While Not (SetupDiEnumDeviceInterfaces(hDev, &H0, TGUID, lCount, DTA) = &H0)
Call SetupDiGetDeviceInterfaceDetail(hDev, DTA, ByVal &H0, &H0, lSize, ByVal &H0)
Call SetupDiGetDeviceInterfaceDetail(hDev, DTA, DTL, ByVal lSize, lSize, ByVal &H0)
If UBound(Split(DTL.strDevicePath, "#")) > 1 Then
cad = cad & Split(UCase$(DTL.strDevicePath), "#")(1) & _
" - " & Split(UCase$(DTL.strDevicePath), "#")(2) & Chr$(&HD)
'cad = cad & DTL.strDevicePath & Chr(10)
End If
lCount = lCount + 1
Wend
Call SetupDiDestroyDeviceInfoList(hDev)
FlashSerials = cad
If FlashSerials = "" Then FlashSerials = "No hay conexiones"
End Function