Visual C++ .NET - Necesito un programa que remplace texto pago por paypal

 
Vista:

Necesito un programa que remplace texto pago por paypal

Publicado por Luis (1 intervención) el 02/06/2012 00:51:48
hola me pregunto quien puede hacerme un programa para remplazo de links???

lo que quiero es hacer mas rapido el trabajo para estar cambiando los links en los megapost, no se pero la idea es esta:

tengo el antiguo link
http://letitbit.net/download/72253.7c6afd669328aac446c69f0aacac/nombre.pelicula.avi.html

lo quiero intercambiar por este:
http://letitbit.net/download/53034.7c6afd669328aac446c69f0aacac/nombre.pelicula.avi.html


seria como hacer 2 textbox y un boton

textbox1 iria el antiguo link
textbox2 irial el nuevo link
un boton para el remplazo

el programa solo tendia que identificar los nombres o la parte final del link: nombre.pelicula.avi.html
y cambiar el antiguo link http://letitbit.net/download/72253.7c6afd669328aac446c69f0aacac/
por el nuevo link http://letitbit.net/download/53034.7c6afd669328aac446c69f0aacac

Alguien podra?
porfavor responda este mensaje o envie un correo a [email protected]?
pueden agregarme al msn.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Alejandro

Creación de programa de reemplazo de links

Publicado por Alejandro (265 intervenciones) el 13/02/2024 17:25:44
Para crear un programa que realice el reemplazo de links como lo describes, puedes seguir estos pasos:

1. Crear un proyecto en Visual C++ .NET: Abre Visual Studio y crea un nuevo proyecto de tipo Windows Forms Application.

2. Diseño de la interfaz de usuario: En el diseñador de formularios, agrega dos TextBox y un Button. Uno de los TextBox será para el antiguo link, el otro para el nuevo, y el Button ejecutará el reemplazo.

3. Codificar la lógica del botón: Maneja el evento Click del botón para realizar el reemplazo de los links. Debes extraer la parte final del link (nombre.pelicula.avi.html) y reemplazar la parte del link antiguo con la nueva.

A continuación, te proporciono un ejemplo de cómo podría ser la implementación en C++/CLI:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Incluye las bibliotecas necesarias
#include "stdafx.h"
#include <string>
 
// Espacio de nombres para el formulario
namespace ReemplazoLinks {
 
    using namespace System;
    using namespace System::Windows::Forms;
 
    // Clase principal del formulario
    public ref class Formulario : public System::Windows::Forms::Form
    {
    public:
        // Constructor del formulario
        Formulario(void)
        {
            InitializeComponent();
        }
 
    protected:
        // Destructor del formulario
        ~Formulario()
        {
            if (components)
            {
                delete components;
            }
        }
 
    private:
        System::Windows::Forms::TextBox^ textBoxAntiguo;
        System::Windows::Forms::TextBox^ textBoxNuevo;
        System::Windows::Forms::Button^ botonReemplazar;
 
        // Método para inicializar los componentes del formulario
        void InitializeComponent(void)
        {
            this->textBoxAntiguo = (gcnew System::Windows::Forms::TextBox());
            this->textBoxNuevo = (gcnew System::Windows::Forms::TextBox());
            this->botonReemplazar = (gcnew System::Windows::Forms::Button());
            this->SuspendLayout();
            //
            // textBoxAntiguo
            //
            this->textBoxAntiguo->Location = System::Drawing::Point(27, 27);
            this->textBoxAntiguo->Name = L"textBoxAntiguo";
            this->textBoxAntiguo->Size = System::Drawing::Size(246, 20);
            this->textBoxAntiguo->TabIndex = 0;
            //
            // textBoxNuevo
            //
            this->textBoxNuevo->Location = System::Drawing::Point(27, 63);
            this->textBoxNuevo->Name = L"textBoxNuevo";
            this->textBoxNuevo->Size = System::Drawing::Size(246, 20);
            this->textBoxNuevo->TabIndex = 1;
            //
            // botonReemplazar
            //
            this->botonReemplazar->Location = System::Drawing::Point(105, 104);
            this->botonReemplazar->Name = L"botonReemplazar";
            this->botonReemplazar->Size = System::Drawing::Size(75, 23);
            this->botonReemplazar->TabIndex = 2;
            this->botonReemplazar->Text = L"Reemplazar";
            this->botonReemplazar->UseVisualStyleBackColor = true;
            this->botonReemplazar->Click += gcnew System::EventHandler(this, &Formulario::botonReemplazar_Click);
            //
            // Formulario
            //
            this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
            this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
            this->ClientSize = System::Drawing::Size(300, 150);
            this->Controls->Add(this->botonReemplazar);
            this->Controls->Add(this->textBoxNuevo);
            this->Controls->Add(this->textBoxAntiguo);
            this->Name = L"Formulario";
            this->Text = L"Reemplazo de links";
            this->ResumeLayout(false);
            this->PerformLayout();
 
        }
 
        // Método para manejar el evento Click del botón
        System::Void botonReemplazar_Click(System::Object^ sender, System::EventArgs^ e)
        {
            // Obtiene el texto de los TextBox
            String^ antiguoLink = textBoxAntiguo->Text;
            String^ nuevoLink = textBoxNuevo->Text;
 
            // Realiza el reemplazo si el antiguo link contiene algo
            if (!String::IsNullOrEmpty(antiguoLink))
            {
                // Realiza el reemplazo
                String^ nombreArchivo = antiguoLink->Substring(antiguoLink->LastIndexOf("/") + 1);
                String^ nuevoLinkCompleto = nuevoLink + nombreArchivo;
 
                // Muestra el nuevo link en el TextBox del nuevo link
                textBoxNuevo->Text = nuevoLinkCompleto;
            }
        }
    };
}

Este es un ejemplo básico para que te familiarices con la idea. Puedes extenderlo agregando más funcionalidades según tus necesidades. Recuerda que el código anterior es para C++/CLI en Visual Studio.

Espero que esta información te sea útil para empezar con tu proyecto. ¡Buena suerte, Luis!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar