| |
|
9571
|
Programación / .NET (C#, VB.NET, ASP) / Re: Visual Basic 2008 Duda
|
en: 20 Marzo 2013, 00:29 am
|
|
Creo que a lo que raul338 se refería es que muestres la parte del código de las variables para especificar el tipo de variable que es, aparte del contenido y de las modificaciones que le hagas...
Ya queda menos, Ahora sólo falta que especifiques lo que intentas hacer...
Saludos!
|
|
|
|
|
9572
|
Programación / Scripting / Re: ¿¿Se puede ocultar la pantalla de comando en el siguiente código??
|
en: 19 Marzo 2013, 21:11 pm
|
Pero si tienes el código, ¿porque no lo pruebas tu mismo para salir de dudas? xD Ese code lo único que hace es mostrar una Caja de texto usando VisualBasicScript. Usa el buscador del foro... set ws = wscript.createobject("WScript.shell") ws.run("notepad.exe"), 0, true
Ahora no dispongo de tiempo, debes modificar los argumentos (%1 %2 %3) del BAT para usar ese code VBS. Saludos!
|
|
|
|
|
9574
|
Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets)
|
en: 19 Marzo 2013, 20:57 pm
|
Esta función es para escribir "hints" (o "cues") en los TextBox por ejemplo. #Region " Set Control Hint Function " ' [ Set Control Hint Function ] ' ' Examples : ' Set_Control_Hint(TextBox1, "Put text here...") <System.Runtime.InteropServices.DllImport("user32.dll", CharSet:=System.Runtime.InteropServices.CharSet.Auto)> _ Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPWStr)> ByVal lParam As String) As Int32 End Function Private Function Set_Control_Hint(ByVal control As Control, ByVal text As String) As Boolean Try SendMessage(control.Handle, &H1501, 0, text) Return True Catch ex As Exception Throw New Exception(ex.Message) End Try End Function #End Region
Enviar POST por PHP: #Region " Send POST PHP Function " ' [ Send POST PHP Function ] ' ' Examples : ' Dim htmlcode As String = PHP("http://somesite.com/somephpfile.php", "POST", "name=Jim&age=27&pizza=suasage") Public Function Send_POST_PHP(ByVal URL As String, ByVal Method As String, ByVal Data As String) As String Try Dim request As System.Net.WebRequest = System.Net.WebRequest.Create(URL) request.Method = Method Dim postData = Data Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes(postData) request.ContentType = "application/x-www-form-urlencoded" request.ContentLength = byteArray.Length Dim dataStream As System.IO.Stream = request.GetRequestStream() dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() Dim response As System.Net.WebResponse = request.GetResponse() dataStream = response.GetResponseStream() Dim reader As New System.IO.StreamReader(dataStream) Dim responseFromServer As String = reader.ReadToEnd() reader.Close() dataStream.Close() response.Close() Return (responseFromServer) Catch ex As Exception Dim PHP_Error As String = ErrorToString() If PHP_Error = "Invalid URI: The format of the URI could not be determined." Then MsgBox("ERROR! Must have HTTP:// before the URL.") Else Throw New Exception(ex.Message) End If Return ("ERROR") End Try End Function #End Region
|
|
|
|
|
9575
|
Foros Generales / Dudas Generales / No puedo leer correos desde la página de Hotmail o.O
|
en: 19 Marzo 2013, 20:48 pm
|
Bueno pues llevo 2 o 3 días así (y me parece que no soy el único):  ¿Le pasa algo al servicio de Microsoft?, me parece algo fuera de lo normal porque he testeado desde Firefox, desde chrome, con una limpieza prévia de cookies porsupuesto, en mi Windows, y en VirtualBox, no me deja pinchar en ningún correo de entrada! y necesito leer un correo importante pero ahora mismo no se me ocurre ningún soft con el que poder leer los correos de Hotmail, ¿Alguna sugerencia?.
|
|
|
|
|
9576
|
Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets)
|
en: 19 Marzo 2013, 18:52 pm
|
Grabar audio del PC: #Region " Rec Sound Function " ' [ Rec Sound Function ] ' ' Examples : ' Rec_Sound("C:\Audio.wav", Rec.Start_Record) ' Rec_Sound("C:\Audio.wav", Rec.Stop_Record) Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Integer, ByVal hwndCallback As Integer) As Integer Public Enum Rec Start_Record Stop_Record End Enum Private Function Rec_Sound(ByVal Path As String, ByVal Rec As Rec) As Boolean Select Case Rec Case Rec.Start_Record mciSendString("open new Type waveaudio Alias recsound", "", 0, 0) mciSendString("record recsound", "", 0, 0) Return True Case Rec.Stop_Record mciSendString("save recsound " & Path & "", "", 0, 0) mciSendString("close recsound", "", 0, 0) Return True Case Else : Return Nothing End Select End Function #End Region
|
|
|
|
|
9578
|
Programación / Scripting / Re: Base de datos desde archivo de texto.
|
en: 19 Marzo 2013, 18:06 pm
|
No hay problema... Este script sólamente comprueba el valor de la última línea.  PD: Las explicaciones están en el código. @Echo OFF SETLOCAL ENABLEDELAYEDEXPANSION
Set /A "Max=100" Set /A "Interval=10" Set /A "LastFileSize=0" Set /A "CurrentFileSize=0"
Set "File=C:\Users\Administrador\Desktop\1.txt"
:Loop
REM Comprueba el tamaño actual del archivo LOG For %%F in ("%File%") Do (Set /A "CurrentFileSize=%%~zF")
REM Si el tamaño actual no es igual al ultimo tamaño registrado [Es decir, si el LOG se ha actualizado...] If %CurrentFileSize% NEQ %LastFileSize% ( Set /A "LastFileSize=%CurrentFileSize%"
Echo [%TIME:~0,-3%] Comprobando actualización del LOG... For /F "Usebackq Tokens=1-3* Delims= " %%A in ("%File%") Do (Set /A "Value=%%C")
REM Si el valor es mayor que X... If !Value! GTR %MAX% ( Echo [%TIME:~0,-3%] Valor: "!Value!" es mayor que "%MAX%". Echo [%TIME:~0,-3%] Enviando e-mail... rem Zulc.exe -receivers="tuemail@hot.com" -remarks="Test remark" -subject="Test subject") ) ELSE ( Echo [%TIME:~0,-3%] Valor: "!Value!" Todo Correcto. ) ) ELSE ( REM De lo contrario... Echo [%TIME:~0,-3%] Nada que comprobar. ) (Ping -n %INTERVAL% Localhost >NUL) & (GOTO :LOOP)
|
|
|
|
|
9579
|
Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Posteen aquí sus snippets)
|
en: 19 Marzo 2013, 17:34 pm
|
Minimizar la IDE del VisualStudio cuando la APP está en debug:
[code=vbnet]#Region " Minimize VS IDE when APP is in execution "
Declare Function ShowWindow Lib "User32.dll" (ByVal hwnd As IntPtr, ByVal nCmdShow As UInteger) As Boolean
' Minimize VS IDE when APP is in execution Private Sub Minimize_VS_IDE_when_APP_is_in_execution(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load #If DEBUG Then Dim Pr() As Process = Process.GetProcesses For Each P As Process In Pr If P.MainWindowTitle.Contains(My.Application.Info.AssemblyName) Then Dim hwnd As IntPtr = P.MainWindowHandle ShowWindow(hwnd, 6) Exit For End If Next #End If End Sub
#End Region
Redondear los bordes de cualquier control: #Region " Round Borders " ' [ Round Borders ] ' ' Examples : ' Round_Border(TextBox1) ' Round_Border(PictureBox1, 100) Private Sub Round_Borders(ByVal vbObject As Object, Optional ByVal RoundSize As Integer = 20) Try Dim p As New Drawing2D.GraphicsPath() p.StartFigure() p.AddArc(New Rectangle(0, 0, RoundSize, RoundSize), 180, 90) p.AddLine(RoundSize, 0, vbObject.Width - RoundSize, 0) p.AddArc(New Rectangle(vbObject.Width - RoundSize, 0, RoundSize, RoundSize), -90, 90) p.AddLine(vbObject.Width, RoundSize, vbObject.Width, vbObject.Height - RoundSize) p.AddArc(New Rectangle(vbObject.Width - RoundSize, vbObject.Height - RoundSize, RoundSize, RoundSize), 0, 90) p.AddLine(vbObject.Width - RoundSize, vbObject.Height, RoundSize, vbObject.Height) p.AddArc(New Rectangle(0, vbObject.Height - RoundSize, RoundSize, RoundSize), 90, 90) p.CloseFigure() vbObject.Region = New Region(p) Catch ex As Exception : Throw New Exception(ex.Message) End Try End Sub #End Region
Decodificar URL: #Region " URL Decode Function " ' [ URL Decode Function ] ' ' Examples : ' Dim URL As String = URL_Decode("http%3A%2F%2Fwww%2Esomesite%2Ecom%2Fpage%2Easp%3Fid%3D5%26test%3DHello+World") Public Function URL_Decode(ByVal Source As String) As String Dim x As Integer = 0 Dim CharVal As Byte = 0 Dim sb As New System.Text.StringBuilder() For x = 0 To (Source.Length - 1) Dim c As Char = Source(x) If (c = "+") Then sb.Append(" ") ElseIf c <> "%" Then sb.Append(c) Else CharVal = Int("&H" & Source(x + 1) & Source(x + 2)) sb.Append(Chr(CharVal)) x += 2 End If Next Return sb.ToString() End Function #End Region
Codificar URL: #Region " URL Encode Function " ' [ URL Encode Function ] ' ' Examples : ' Dim URL As String = URL_Encode("http://www.somesite.com/page.asp?id=5&test=Hello World") Public Function URL_Encode(ByVal Source As String) As String Dim chars() As Char = Source.ToCharArray() Dim sb As New System.Text.StringBuilder() For Each c As Char In chars If c Like "[A-Z-a-z-0-9]" Then sb.Append(c) ElseIf c = " " Then sb.Append("+") Else Dim sHex As String = Hex(Asc(c)) sHex = "%" & sHex.PadLeft(2, "0") sb.Append(sHex) End If Next Erase chars ' Clean Up Return sb.ToString() End Function #End Region
[/code]
|
|
|
|
|
9580
|
Programación / Desarrollo Web / Re: ¿ Como cambiar el fondo de color ?
|
en: 19 Marzo 2013, 16:02 pm
|
|
El color naranja de tu htm es eso, un color sólido.
El gradiante no es un color, es un efecto de varios tonos de colores conjuntos, y los estilos (efectos, gradiantes) se hacen manejando CSS, si usas DreamWeaver los estilos de CSS te los hace en 1 segundo casi sin esfuerzo vaya!
Un saludo!
|
|
|
|
|
|
| |
|