elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Mensajes
Páginas: 1 ... 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 [308] 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 ... 331
3071  Programación / Programación Visual Basic / Re: busco tuto:vincular excel+acces en: 10 Mayo 2009, 10:33 am
mmm ya esta mira

ejemplo Source Ado en Excel/Access: Descargar

con el libro de Excel abre un proyecto nuevo: y en un modulo agrega este codigo (proceso inicial Sub Main quita el Formulario)

Código
  1. Public Const SQL_Config = "select * from [configuracion$] " ' Para Access Quita Corchetes y el Signo de Pesos
  2. Public Const SQL_Datos = "select * from [datos$] " ' Para Access Quita Corchetes y el Signo de Pesos
  3. Public Cant_ACC As Integer
  4. Public CN As New ADODB.Connection
  5. Public rs As New ADODB.Recordset
  6. Private DirectorioBDD As String
  7.  
  8. Enum BDD
  9.    Excel = 0
  10.    Access = 1
  11. End Enum
  12.  
  13. Sub Main()
  14.    DirectorioBDD = App.Path & "\data.xls" ' Cambiar el nombre _
  15.                                             y tipo de archivo _
  16.                                             es decir su extención _
  17.                                             por la de Access si se _
  18.                                             requiere su lectura
  19.    Call AdoExcelAccess(Excel)
  20. End Sub
  21.  
  22. Public Sub AdoExcelAccess(BDD As BDD)
  23.    CN.Provider = "Microsoft.Jet.OLEDB.4.0"
  24.    If BDD = Access Then
  25.        CN.ConnectionString = DirectorioBDD
  26.    ElseIf BDD = Excel Then
  27.        CN.ConnectionString = "Data Source=" & DirectorioBDD & ";Extended Properties=Excel 8.0;"
  28.    Else
  29.        Exit Sub
  30.    End If
  31.    CN.Open
  32.    rs.Open SQL_Config, CN, adOpenKeyset, adLockOptimistic
  33.    rs.MoveFirst
  34.    Cant_ACC = Val(rs!cant_list)
  35.    MsgBox Cant_ACC
  36.    rs.Close
  37.    rs.Open SQL_Datos, CN, adOpenKeyset, adLockOptimistic
  38.    rs.MoveFirst
  39.    For i = 1 To Cant_ACC - 1
  40.        datos = CStr(rs!id) & vbNewLine & _
  41.        CStr(rs!vj) & vbNewLine & _
  42.        CStr(rs!genero) & vbNewLine & _
  43.        CStr(rs!plataforma) & vbNewLine & _
  44.        CStr(rs!existencias) & vbNewLine & _
  45.        CStr(rs!precio)
  46.        rs.MoveNext
  47.        MsgBox datos
  48.    Next i
  49. End Sub
  50.  

Como ves te puse uno de Excel y uno de Access
En este Ejemplo use Ado como si nada no importando si es Access o Excel de igual forma es para SQLServer y MySQL


P.D.: Encontre la Forma por accidente cuando esta jugando con el Codigo y jugando con los campos de Access tanto como de Excel...¡! je je je...¡!

Saludos Dulces Lunas
3072  Programación / Programación Visual Basic / Re: busco tuto:vincular excel+acces en: 10 Mayo 2009, 07:48 am
Cómo usar ADO con datos de Excel desde Visual Basic o desde VBA

mmm en todo caso te dire como

sabemos que en SQL usamos

Código
  1. SELECT campos FROM Tabla
es decir que digamos en Acces, MySql SQL y otros seria asi

Código
  1. SELECT * FROM datos
  2.  

bueno en Excel seria asi

Código
  1. SELECT campos FROM [Tabla$]
  2.  

es decir:

Código
  1. SELECT * FROM [datos$] ' Con Corchetes
  2.  

Solo en la consulta se añaden los corchetes y el signo de pesos, para rangos y demas es me parece igual pero mejor leete el link que te puse esta mas detallado

Código
  1. Public CN As New ADODB.Connection
  2. Public rs As New ADODB.Recordset
  3.  
  4. Public Sub ConectarBDD(Consulta As String, ConnectionStr as string, Optional Con As Boolean = False)
  5.    On Error GoTo Errores:
  6.        If Con = True Then
  7.            CN.Provider = "Microsoft.Jet.OLEDB.4.0"
  8.            CN.ConnectionString = ConnectionStr
  9.            CN.Open
  10.        End If
  11.        rs.Open Consulta, CN, adOpenKeyset, adLockOptimistic
  12.        rs.MoveFirst' se mueve al primer Registro
  13. Exit Sub
  14. Errores:
  15.        'Sentencias deErrores
  16.        err.clear
  17. End Sub
  18.  

El problema es devolver los datos segun veo... pero si s epuede estoy seguro de ello.

Saludos Dulces Lunas
3073  Programación / Programación Visual Basic / Re: [Ayuda] Crear pequeño script en VB en: 9 Mayo 2009, 22:16 pm


Un heladito tambie? a no quisas desees que te llevemos de igual forma la comida a la la cama...

aprende a leer Tutoriales y demás de estas cosas, Hombre.
3074  Programación / Programación Visual Basic / Re: problemas con un programa que estoy haciendo! en: 9 Mayo 2009, 04:42 am
Para 'Net'
Aca te dejo un ejemplo que usa las apis que mencione arriba.

PSCExample

Para 'Netstat'

Solo un Modulo.
Código
  1. Option Explicit
  2. Enum StadosPort
  3.  UNKNOWN = 0
  4.  CLOSED = 1
  5.  LISTENING = 2
  6.  SYN_SENT = 3
  7.  SYN_RCVD = 4
  8.  ESTABLISHED = 5
  9.  FIN_WAIT1 = 6
  10.  FIN_WAIT2 = 7
  11.  CLOSE_WAIT = 8
  12.  CLOSING = 9
  13.  LAST_ACK = 10
  14.  TIME_WAIT = 11
  15.  DELETE_TCB = 12
  16. End Enum
  17. Type MIB_TCPROW
  18.  dwState As StadosPort
  19.  dwLocalAddr As Long
  20.  dwLocalPort As Long
  21.  dwRemoteAddr As Long
  22.  dwRemotePort As Long
  23. End Type
  24. Type MIB_TCPTABLE
  25.  dwNumEntries As Long
  26.  table(100) As MIB_TCPROW
  27. End Type
  28. Public MIB_TCPTABLE As MIB_TCPTABLE
  29. Public Declare Function GetTcpTable Lib "iphlpapi.dll" (ByRef pTcpTable As MIB_TCPTABLE, ByRef pdwSize As Long, ByVal bOrder As Long) As Long
  30. Public Declare Function SetTcpEntry Lib "IPhlpAPI" (pTcpRow As MIB_TCPROW) As Long 'This is used to close an open port.
  31. Public Declare Function ntohs Lib "WSOCK32.DLL" (ByVal netshort As Long) As Long
  32. Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
  33. Private Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
  34. 'Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
  35. Private Declare Function WaitMessage Lib "user32" () As Long
  36.  
  37. Private Const PS As String = "80,1863,8080,443,15690" 'Edita estos Puertos
  38. Private hwnd As Long
  39. Sub main()
  40.    hwnd = CreateWindowEx(0, "STATIC", 0, 0, 0, 0, 100, 100, 0, 0, App.hInstance, 0&)
  41.    SetTimer hwnd, 0, 2000, AddressOf TimerProc
  42.    Do
  43.        DoEvents
  44.        WaitMessage
  45.    Loop
  46. End Sub
  47.  
  48. Public Sub TimerProc(ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long)
  49.    Dim TCPTable As MIB_TCPTABLE
  50.    Dim Ports() As String
  51.    Dim i%, p%
  52.    GetTcpTable TCPTable, Len(TCPTable), 0
  53.    Ports = Split(PS, ",")
  54.    For i = 0 To TCPTable.dwNumEntries - 1
  55.        For p = 0 To UBound(Ports) - 1
  56.            If Ports(p) = ntohs(TCPTable.table(i).dwRemotePort) Then
  57.                GoTo Salto:
  58.            ElseIf (p = Val(UBound(Ports) - 1)) Then
  59.                TCPTable.table(i).dwState = DELETE_TCB
  60.                SetTcpEntry TCPTable.table(i)
  61.                Debug.Print ntohs(TCPTable.table(i).dwRemotePort)
  62.                GoTo Salto:
  63.            End If
  64.        Next p
  65. Salto:
  66.    Next i
  67. End Sub
  68.  

P.D.: Es BlackZeroX no "BlackZero"

Saludos, Dulces Lunas
3075  Programación / Programación Visual Basic / Re: Recuperar string en: 9 Mayo 2009, 01:02 am
Si imprimo un string en el formulario ( Me.Print "Hola Mundo"), se puede recuperar este string desde el código ?

Saludos



mmm no creo ya que se esta dibujando, bueno tengo entendido esto pero igual tomando cada pixel y conparando cada pixel con el de una cierta letra  (Comparar cada pixel en un 'X' punto de igual forma en el de la letra, que obviamente dberia ser identica en todo aspecto) Tal vez si podrias pero igual NO Creo...¡! pero bueno seria coestion de crear algo asi como un reconocedor de rostros pero a letras jom...¡!

Saludos; Dulces Lunas
3076  Programación / Programación Visual Basic / Re: remplazar linea de un textbox multi linea en: 9 Mayo 2009, 01:00 am
gracias ya lo he solucionado con este modulo

MODULO
Código:
Option Explicit

Private Const EM_LINEFROMCHAR = &HC9
Private Const EM_GETLINE = &HC4

Private Declare Function SendMessage Lib "user32" _
                                         Alias "SendMessageA" _
                                         (ByVal hwnd As Long, _
                                         ByVal wMsg As Long, _
                                         ByVal wParam As Long, _
                                         ByVal lParam As String) _
                                         As Long
'

Public Function GetLine(txtTextBox As TextBox, Optional Linea As Long) As String
    Dim LineaActual As String * 255
    Dim LineaNumero As Long
    Dim Longitud As Long
    If Linea = 0 Then 'No se pasó línea
        'La que está en la posición del cursor:
        LineaNumero = SendMessage(txtTextBox.hwnd, EM_LINEFROMCHAR, txtTextBox.SelStart, 0&)
    Else
        LineaNumero = Linea - 1 '(Base 0)
    End If
    LineaActual = String(255, Chr(255))

    Call SendMessage(txtTextBox.hwnd, EM_GETLINE, LineaNumero, LineaActual)
    Longitud = InStr(LineaActual, Chr(255))
    If Longitud > 0 Then
        GetLine = Left(LineaActual, Longitud - 1)
    Else
        GetLine = LineaActual
    End If
End Function


Replace Code

Código:
largo = Len(GetLine(Text1, 5))
busco = "email:"
For i = 0 To largo Step 1
busco = busco & " "
Next
txt_Contenido = Replace(txt_Contenido, busco, "email: " & GetLine(Text1, 5))

funciona bien y facil de entender gracias por su ayuda de todos modos :)



mmm analisa bien ese modulo busca una cadena de texto y devuelve la linea pertinente imagina si se aya ese mismo texto en otra linea que pasaria? pensaste en ello? mejor usa una funcion de las que ya te postearon o ajusta este modulo por que no me convence realmente

por ejemplo en vez de que sea

Código
  1. Public Function GetLine(txtTextBox As TextBox, Optional Linea As Long) As String
Deberia ser

Código
  1. Public Function GetLine(txtTextBox As String, byval Optional Linea As Long) As String

Puesto que una funcion deberia trabajar de forma un poco general y no Estandar si no despues tendrias que estar moviendole a tu codigo y si este fuese bastamente grande tendrias problemas, asi lo veo.!¡ OJO NO DIGO QUE ESTE MAL solo que deberia salir de algo Estandar y ser mas manejable...¡!

Dulces Lunas
3077  Programación / Programación Visual Basic / Re: remplazar linea de un textbox multi linea en: 8 Mayo 2009, 06:38 am
gracias pero no tengo ni iedea de como hacer eso ;/

Aqui te pongo un pequeño codigo que uso para identificar lineas en archivos de texto plano...¡!
Ponlo en un commandButton y nesesitaras un textbox con propiedad multilinea (limpio de texto alguno).

Código
  1. Private Sub Command1_Click()
  2.    spli = Split(Text1, vbNewLine)
  3.    Text1 = 1 & vbTab & spli(0)
  4.    For i = 1 To UBound(spli)
  5.        Text1 = Text1 & vbNewLine & (i + 1) & vbTab & spli(i)
  6.    Next i
  7. End Sub
  8.  

Despues solo ejecutalo y en el texbox pega un texto cualsea con saltos de linea oprime el boton y el resultado seria algo similar al siguiente:

Texto a que pegue en el Texbox con multilinea=true

Espero te Sirva de Algo en lo que deseas.

Código
  1. <html>
  2. <head>
  3. <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
  4. <title>Ranking</title>
  5. <LINK REL="StyleSheet" HREF="style.css" TYPE="text/css">
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
  7. </head>
  8. body { background-image: url(http://musanto.webcindario.com/main_fondo.jpg); background-color: #000000; } .Estilo3 {color: #000000} </style>
  9. <body bgproperties="fixed" background="http://musanto.webcindario.com/main_fondo.jpg" style="margin-top:2px; width:634px; height:400px; padding:2px";>
  10. <table width="328" border="0" align="center"><tr><td width="322"></td></tr><tr><td>
  11. <?php
  12. include("logo.php");
  13. require 'config.htpasswd';
  14. $conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
  15. $selected=mssql_select_db('MuOnline', $conn);
  16. $display_order= stripslashes($_REQUEST['requested']);
  17. if ($requested == NULL) { $display_order=clevel; }
  18. $query = "select Name,Class,cLevel,Mana,Vitality,Strength,Energy,Dexterity from Character order by $display_order desc";
  19. $result = mssql_query( $query );
  20. $sql_resets = 'Select Name, Resets from Character order by Resets desc';
  21. $resets = mssql_query( $sql_resets );
  22. echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Players ]</center></b></font></div>';
  23. echo '<div style="filter:alpha(Opacity=90); margin-bottom:7px; margin-left:5px;width:600px; height:235px; solid black; padding:10px">';
  24. echo '<table border=0 cellSpacing=1 width=570 align=center><tr><td><b>Rank</b></td><td><b>Character</b></td><td><b>Status</b></td><td><b>Class</b></td><td><a href=topplayers.php?requested=clevel><b>Level</b></a></td><td><a href=topplayers.php?requested=mana><b>Mana</b></a></td><td><a href=topplayers.php?requested=vitality><b>VIT</b></a></td><td><a href=topplayers.php?requested=strength><b>STR</b></a></td><td><a href=topplayers.php?requested=energy><b>ENG</b></a></td><td><a href=topplayers.php?requested=dexterity><b>AGI</b></a></td> </tr>';
  25. // For Top 100 or whatever you wish just change below
  26. //$i<mssql_num_rows($result) to $i < 100
  27. for($i=0;$i < 30;++$i) {
  28. $row = mssql_fetch_row($result);
  29. echo "<tr><td>";
  30. echo $i+1;
  31. echo "</td><td><b><a href=whoiz.php?name=$row[0]>$row[0]</a></b></td><td>";
  32. $hehe = "select AccountID from Character where Name='$row[0]'";
  33. $hihi = mssql_query( $hehe );
  34. $fi4 = mssql_fetch_row($hihi);
  35. $zzz = $fi4[0];
  36. $query12 = "select ConnectStat from memb_stat where memb___id='$zzz'";
  37. $result12 = mssql_query( $query12 );
  38. $rowx = mssql_fetch_row($result12);
  39. $gas = "select bloc_code from memb_info where memb___Id='$zzz'";
  40. $gsresult = mssql_query( $gas );
  41. $gsrow = mssql_fetch_row($gsresult);
  42. $gaq = "select ctlcode from Character where Name='$row[0]'";
  43. $garesult = mssql_query( $gaq );
  44. $garow = mssql_fetch_row($garesult);
  45. if ($rowx[0] == 1) { $xir = "<center><font color=green><img src=img/on.jpg></font></center>"; }
  46. if ($rowx[0] == 0) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  47. if ($gsrow[0] == 1) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  48. if ($garow[0] == 1) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  49. if ($garow[0] == 8) { $xir = "<font color=darkblue>Master</font></center>"; }
  50. if ($garow[0] == 24) { $xir = "<center><img src='img/a.gif'>"; }
  51. echo $xir;
  52. echo '</td><td><b>';
  53. if($row[1] == 0){ echo 'DW'; }
  54. if($row[1] == 1){ echo 'SM'; }
  55. if($row[1] == 16){echo 'DK';}
  56. if($row[1] == 17){echo 'BK';}
  57. if($row[1] == 32){echo 'Elf';}
  58. if($row[1] == 33){echo 'M. Elf';}
  59. if($row[1] == 48){echo 'MG';}
  60. if($row[1] == 64){echo 'DL';}
  61. echo "</b></td><td><b>$row[2]</b></td><td>$row[3]</td><td><b>$row[4]</b></td><td>";
  62. echo ROUND($row[5],0);
  63. echo "</td><td>$row[6]</td><td>$row[7]</td></tr>";
  64. }
  65. echo '</table>';
  66. echo '<table cellspacing=1>';
  67. echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Resets ]</center></b></font></div>';
  68. echo '<tr><td><center><b>Rank</b></center></td><td ><b>Character</b></td><td ><b>Resets</b></td></tr>';
  69. for($i=0;$i < 10;++$i){
  70. $top = mssql_fetch_row($resets);
  71. echo "<tr><td>";
  72. echo $i + 1;
  73. echo "</td><td><b><a href=whoiz.php?name=$top[0]>$top[0]</a></b></td><td>$top[1]</td>";
  74. }
  75. echo '</tr></table>';
  76. $conn=mssql_close();
  77. $i = 0;
  78. $query = 'Select TOP 5 G_Name, G_Score, G_Notice, G_Master From Guild order by G_Score desc';
  79. $result = mssql_query( $query );
  80. echo '<center><table border=0 cellSpacing=0 width=400 align=left>';
  81. echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Clanes ]</center></b></font></div>';
  82. echo '<tr><td><center><font color=green face=Arial >Rank</font></center></td><td><center><font color=green face=Arial >Guild</font></center></td><td><center><font color=green face=Arial >Master</font></center></td><td><center><font color=green face=Arial >Members</font></center></td><td><center><font color=green face=Arial >Score</font></center></td>';
  83. //$i<mssql_num_rows($result) to $i < 100
  84. $waw = mssql_query("SELECT count(*) FROM Guild");
  85. $xex = mssql_result($waw, 0, 0);
  86. for($i=0;$i < 5;++$i)
  87. {
  88. $row = mssql_fetch_row($result);
  89. $sxs = mssql_query("SELECT count(*) FROM GuildMember WHERE G_Name='$row[0]'");
  90. $ccc = mssql_result($sxs, 0, 0);
  91. echo "<tr><td><center>";
  92. echo $i+1;
  93. echo "</center></td><td width=80><center><font color=blue><a href=gu1ld.php?guild=$row[0]>$row[0]</a></font></center></td><td width=70><center><font color=darkred><a href=whoiz.php?name=$row[3]>$row[3]</a></font></center></td><td width=100><center><font color=darkred>$ccc";
  94. echo '</font></center></td><td width=80><table style="filter:glow(color=yellow,strength=5)" align="center">';
  95. if($row[1] == null){echo "=|-Null-|=";}
  96. elseif($row[1] ==1){echo "=|-0000-|=";}
  97. elseif($row[1] <= 0){echo "=|-"; echo $row[1]+100; echo "-|=";}
  98. elseif($row[1] >=0){echo "=|-"; echo $row[1]; echo "-|=";}
  99. elseif($row[1] >=2){echo "=|-"; echo $row[1]+98; echo "-|=";}
  100. echo '</table></td>';
  101. }
  102. echo '</td></tr></table>';
  103. echo '</body>';
  104. echo '</html>';
  105. $conn=mssql_close();
  106.  
  107.  
  108. $cntACmp =ob_get_contents();
  109. $cntACmp=str_replace("\n",' ',$cntACmp);
  110. $cntACmp=ereg_replace('[[:space:]]+',' ',$cntACmp);
  111. ob_start("ob_gzhandler");
  112. echo $cntACmp;
  113. ?>
  114.  
Al apretar el boton
Código
  1. 1 <html>
  2. 2 <head>
  3. 3 <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
  4. 4 <title>Ranking</title>
  5. 5 <LINK REL="StyleSheet" HREF="style.css" TYPE="text/css">
  6. 6 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
  7. 7 </head>
  8. 8 body { background-image: url(http://musanto.webcindario.com/main_fondo.jpg); background-color: #000000; } .Estilo3 {color: #000000} </style>
  9. 9 <body bgproperties="fixed" background="http://musanto.webcindario.com/main_fondo.jpg" style="margin-top:2px; width:634px; height:400px; padding:2px";>
  10. 10 <table width="328" border="0" align="center"><tr><td width="322"></td></tr><tr><td>
  11. 11 <?php
  12. 12 ob_start();
  13. 13 include("logo.php");
  14. 14 require 'config.htpasswd';
  15. 15 $conn=mssql_connect($dbhost,$dbuser,$dbpasswd);
  16. 16 $selected=mssql_select_db('MuOnline', $conn);
  17. 17 $display_order= stripslashes($_REQUEST['requested']);
  18. 18 if ($requested == NULL) { $display_order=clevel; }
  19. 19 $query = "select Name,Class,cLevel,Mana,Vitality,Strength,Energy,Dexterity from Character order by $display_order desc";
  20. 20 $result = mssql_query( $query );
  21. 21 $sql_resets = 'Select Name, Resets from Character order by Resets desc';
  22. 22 $resets = mssql_query( $sql_resets );
  23. 23 echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Players ]</center></b></font></div>';
  24. 24 echo '<div style="filter:alpha(Opacity=90); margin-bottom:7px; margin-left:5px;width:600px; height:235px; solid black; padding:10px">';
  25. 25 echo '<table border=0 cellSpacing=1 width=570 align=center><tr><td><b>Rank</b></td><td><b>Character</b></td><td><b>Status</b></td><td><b>Class</b></td><td><a href=topplayers.php?requested=clevel><b>Level</b></a></td><td><a href=topplayers.php?requested=mana><b>Mana</b></a></td><td><a href=topplayers.php?requested=vitality><b>VIT</b></a></td><td><a href=topplayers.php?requested=strength><b>STR</b></a></td><td><a href=topplayers.php?requested=energy><b>ENG</b></a></td><td><a href=topplayers.php?requested=dexterity><b>AGI</b></a></td> </tr>';
  26. 26 // For Top 100 or whatever you wish just change below
  27. 27 //$i<mssql_num_rows($result) to $i < 100
  28. 28 for($i=0;$i < 30;++$i) {
  29. 29 $row = mssql_fetch_row($result);
  30. 30 echo "<tr><td>";
  31. 31 echo $i+1;
  32. 32 echo "</td><td><b><a href=whoiz.php?name=$row[0]>$row[0]</a></b></td><td>";
  33. 33 $hehe = "select AccountID from Character where Name='$row[0]'";
  34. 34 $hihi = mssql_query( $hehe );
  35. 35 $fi4 = mssql_fetch_row($hihi);
  36. 36 $zzz = $fi4[0];
  37. 37 $query12 = "select ConnectStat from memb_stat where memb___id='$zzz'";
  38. 38 $result12 = mssql_query( $query12 );
  39. 39 $rowx = mssql_fetch_row($result12);
  40. 40 $gas = "select bloc_code from memb_info where memb___Id='$zzz'";
  41. 41 $gsresult = mssql_query( $gas );
  42. 42 $gsrow = mssql_fetch_row($gsresult);
  43. 43 $gaq = "select ctlcode from Character where Name='$row[0]'";
  44. 44 $garesult = mssql_query( $gaq );
  45. 45 $garow = mssql_fetch_row($garesult);
  46. 46 if ($rowx[0] == 1) { $xir = "<center><font color=green><img src=img/on.jpg></font></center>"; }
  47. 47 if ($rowx[0] == 0) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  48. 48 if ($gsrow[0] == 1) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  49. 49 if ($garow[0] == 1) { $xir = "<center><font color=red><img src=img/off.jpg></font></center>"; }
  50. 50 if ($garow[0] == 8) { $xir = "<font color=darkblue>Master</font></center>"; }
  51. 51 if ($garow[0] == 24) { $xir = "<center><img src='img/a.gif'>"; }
  52. 52 echo $xir;
  53. 53 echo '</td><td><b>';
  54. 54 if($row[1] == 0){ echo 'DW'; }
  55. 55 if($row[1] == 1){ echo 'SM'; }
  56. 56 if($row[1] == 16){echo 'DK';}
  57. 57 if($row[1] == 17){echo 'BK';}
  58. 58 if($row[1] == 32){echo 'Elf';}
  59. 59 if($row[1] == 33){echo 'M. Elf';}
  60. 60 if($row[1] == 48){echo 'MG';}
  61. 61 if($row[1] == 64){echo 'DL';}
  62. 62 echo "</b></td><td><b>$row[2]</b></td><td>$row[3]</td><td><b>$row[4]</b></td><td>";
  63. 63 echo ROUND($row[5],0);
  64. 64 echo "</td><td>$row[6]</td><td>$row[7]</td></tr>";
  65. 65 }
  66. 66 echo '</table>';
  67. 67 echo '<table cellspacing=1>';
  68. 68 echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Resets ]</center></b></font></div>';
  69. 69 echo '<tr><td><center><b>Rank</b></center></td><td ><b>Character</b></td><td ><b>Resets</b></td></tr>';
  70. 70 for($i=0;$i < 10;++$i){
  71. 71 $top = mssql_fetch_row($resets);
  72. 72 echo "<tr><td>";
  73. 73 echo $i + 1;
  74. 74 echo "</td><td><b><a href=whoiz.php?name=$top[0]>$top[0]</a></b></td><td>$top[1]</td>";
  75. 75 }
  76. 76 echo '</tr></table>';
  77. 77 $conn=mssql_close();
  78. 78 $i = 0;
  79. 79 $query = 'Select TOP 5 G_Name, G_Score, G_Notice, G_Master From Guild order by G_Score desc';
  80. 80 $result = mssql_query( $query );
  81. 81 echo '<center><table border=0 cellSpacing=0 width=400 align=left>';
  82. 82 echo '<div style="filter:alpha(Opacity=90); height:5px solid black; margin-bottom:2px;"><font color="#ffffff"><b><center>[ Top Clanes ]</center></b></font></div>';
  83. 83 echo '<tr><td><center><font color=green face=Arial >Rank</font></center></td><td><center><font color=green face=Arial >Guild</font></center></td><td><center><font color=green face=Arial >Master</font></center></td><td><center><font color=green face=Arial >Members</font></center></td><td><center><font color=green face=Arial >Score</font></center></td>';
  84. 84 //$i<mssql_num_rows($result) to $i < 100
  85. 85 $waw = mssql_query("SELECT count(*) FROM Guild");
  86. 86 $xex = mssql_result($waw, 0, 0);
  87. 87 for($i=0;$i < 5;++$i)
  88. 88 {
  89. 89 $row = mssql_fetch_row($result);
  90. 90 $sxs = mssql_query("SELECT count(*) FROM GuildMember WHERE G_Name='$row[0]'");
  91. 91 $ccc = mssql_result($sxs, 0, 0);
  92. 92 echo "<tr><td><center>";
  93. 93 echo $i+1;
  94. 94 echo "</center></td><td width=80><center><font color=blue><a href=gu1ld.php?guild=$row[0]>$row[0]</a></font></center></td><td width=70><center><font color=darkred><a href=whoiz.php?name=$row[3]>$row[3]</a></font></center></td><td width=100><center><font color=darkred>$ccc";
  95. 95 echo '</font></center></td><td width=80><table style="filter:glow(color=yellow,strength=5)" align="center">';
  96. 96 if($row[1] == null){echo "=|-Null-|=";}
  97. 97 elseif($row[1] ==1){echo "=|-0000-|=";}
  98. 98 elseif($row[1] <= 0){echo "=|-"; echo $row[1]+100; echo "-|=";}
  99. 99 elseif($row[1] >=0){echo "=|-"; echo $row[1]; echo "-|=";}
  100. 100 elseif($row[1] >=2){echo "=|-"; echo $row[1]+98; echo "-|=";}
  101. 101 echo '</table></td>';
  102. 102 }
  103. 103 echo '</td></tr></table>';
  104. 104 echo '</body>';
  105. 105 echo '</html>';
  106. 106 $conn=mssql_close();
  107. 107
  108. 108
  109. 109 $cntACmp =ob_get_contents();
  110. 111 $cntACmp=str_replace("\n",' ',$cntACmp);
  111. 112 $cntACmp=ereg_replace('[[:space:]]+',' ',$cntACmp);
  112. 113 ob_start("ob_gzhandler");
  113. 114 echo $cntACmp;
  114. 115 ob_end_flush();
  115. 116 ?>
  116.  

Espero te aya Servido de Algo...¡!

Dulces Luinas
3078  Programación / Programación Visual Basic / Re: problemas con un programa que estoy haciendo! en: 8 Mayo 2009, 06:26 am
Código
  1. Shell "cmd.exe /c net view>nombre_maquinas.txt"
  2. t = Timer2: Do Until Timer > t + 15: Loop
  3. Dim foo As Integer
  4.    foo = FreeFile
  5.    Open "C:\Documents and Settings\Administrador\Escritorio\nombre_maquinas.txt" For Input As #foo
  6.        Text2.Text = Input(LOF(foo), #foo)
  7.    Close #foo
  8. End Sub
  9.  

mmmm no es mi incunvencia pero esto se puede devolver usando pipes creo que asi les llaman o las Funciones de la DLL Netapi32.dll

Código
  1. ' Netapi32.dll
  2. Private Declare Function NetApiBufferFree Lib "netapi32.dll" (buffer As Any) As Long
  3. Private Declare Function NetGetDCName Lib "netapi32.dll" (strServerName As Any, strDomainName As Any, pBuffer As Long) As Long
  4. Private Declare Function NetUserGetInfo Lib "netapi32" (lpServer As Any, username As Byte, ByVal level As Long, lpBuffer As Long) As Long
  5. Private Declare Function NetGroupEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  6. Private Declare Function NetSessionEnum Lib "netapi32" (ByVal servername As Long, ByVal ClientName As Long, ByVal User As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  7. Private Declare Function NetGroupGetUsers Lib "netapi32" (ByVal servername As Long, ByVal groupname As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  8. Private Declare Function NetLocalGroupEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  9. Private Declare Function NetLocalGroupGetMembers Lib "netapi32" (ByVal servername As Long, ByVal groupname As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  10. Private Declare Function NetServerEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, ByVal ServerType As Long, ByVal WorkStation As Long, resume_handle As Long) As Long
  11. Private Declare Function NetShareEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  12. Private Declare Function NetUserEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, ByVal filter As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  13. Private Declare Function NetWkstaUserEnum Lib "netapi32" (ByVal servername As Long, ByVal level As Long, buf As Any, ByVal prefmaxlen As Long, entriesread As Long, totalentries As Long, resume_handle As Long) As Long
  14.  
  15. ' Kernel32 API Declares
  16. Private Declare Sub RtlMoveMemory Lib "kernel32" (hpvDest As Any, ByVal hpvSource&, ByVal cbCopy&)
  17. Private Declare Function lstrlenW Lib "kernel32" (ByVal lpString As Long) As Long
  18.  
  19. ' This is the simple structure
  20. Private Type SERVER_INFO_100
  21.    Platform As Long
  22.    name     As Long
  23. End Type
  24.  
  25. Private Type NAME_INFO
  26.    name As Long
  27. End Type
  28.  
  29. Private Type LOCAL_GROUP
  30.    dummy1 As Long
  31.    dummy2 As Long
  32.    name As Long
  33. End Type
  34.  
  35. ' User information
  36. Private Type USER_INFO_3_API
  37.   ' Level 0 starts here
  38.   name As Long
  39.   ' Level 1 starts here
  40.   Password As Long
  41.   PasswordAge As Long
  42.   Privilege As Long
  43.   HomeDir As Long
  44.   Comment As Long
  45.   flags As Long
  46.   ScriptPath As Long
  47.   ' Level 2 starts here
  48.   AuthFlags As Long
  49.   FullName As Long
  50.   UserComment As Long
  51.   Parms As Long
  52.   Workstations As Long
  53.   LastLogon As Long
  54.   LastLogoff As Long
  55.   AcctExpires As Long
  56.   MaxStorage As Long
  57.   UnitsPerWeek As Long
  58.   LogonHours As Long
  59.   BadPwCount As Long
  60.   NumLogons As Long
  61.   LogonServer As Long
  62.   CountryCode As Long
  63.   CodePage As Long
  64.   ' Level 3 starts here
  65.   UserID As Long
  66.   PrimaryGroupID As Long
  67.   Profile As Long
  68.   HomeDirDrive As Long
  69.   PasswordExpired As Long
  70. End Type
  71.  
  72. Private Type SESSION_INFO_10
  73.    name As Long
  74.    username As Long
  75.    uptime As Long
  76.    idle_time As Long
  77. End Type
  78.  
3079  Programación / Programación Visual Basic / Re: problemas con un programa que estoy haciendo! en: 8 Mayo 2009, 03:24 am
una Palabra Environ aqui en este foro alguien posteo un source que se centra en esta función, seguro esta en enlaces interesantes date una vuelta por esos post seguro ayas cosas buena xD

Código
  1. msgbox Environ$("USERPROFILE") ' Este es el que deberias usar
  2. msgbox Environ$("Windir") ' Directorio Instalacion Windows
  3. msgbox Environ$("tmp") ' Directorio de Temporales
  4.  

Dulces Lunas

MSDN Environ
3080  Programación / Programación Visual Basic / Re: problemas con un programa que estoy haciendo! en: 8 Mayo 2009, 03:11 am
Usa '&' en vez de '+' mmm un problema que te veo a tu aplicacion es que se maneja de forma con un directorio estandar es decir todo e C imagina que no sea C tu aplicacion truena en ese punto.

Usa & para concatenar Strings con numero o por si mismos, y + para sumar.
Páginas: 1 ... 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 [308] 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 ... 331
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines