PontoExe

Untitled

Aug 6th, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11.  
  12. namespace ClickSite.AAA
  13. {
  14.  
  15.  
  16. public partial class NameOfDiv : Form
  17. {
  18. public string textodatextbox;
  19. Form2 noway = new Form2();
  20.  
  21. public NameOfDiv()
  22. {
  23. InitializeComponent();
  24. Teste scriptlog = new Teste();
  25.  
  26. string vsf = textodatextbox = textBox1.Text;
  27. scriptlog.EscreverLog(vsf);
  28.  
  29.  
  30. }
  31.  
  32. private void button1_Click(object sender, EventArgs e)
  33. {
  34. atimala();
  35. }
  36. private void atimala()
  37. {
  38. if (!string.IsNullOrWhiteSpace(textodatextbox))
  39. {
  40. MessageBox.Show("Não digitou nada");
  41. }
  42. else
  43. {
  44. textodatextbox = textBox1.Text;
  45.  
  46. int startindex = noway.textorealdarich.IndexOf("<body>");
  47. int endindex = noway.textorealdarich.IndexOf("</body>");
  48.  
  49. if(startindex != -1 && endindex != -1)
  50. {
  51. string contentbeforebody = noway.textorealdarich.Substring(0, startindex + 6);
  52. string contentafterbody = noway.textorealdarich.Substring(endindex);
  53. string div = @"<div>
  54.  
  55. </div>";
  56. string novoscomands = contentbeforebody + div + contentafterbody;
  57. noway.textorealdarich = novoscomands;
  58.  
  59.  
  60. }
  61. this.Close();
  62. }
  63.  
  64. }
  65. }
  66. }
  67.  
Add Comment
Please, Sign In to add comment