Register for your free account! | Forgot your password?

You last visited: Today at 05:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] A text editor

Discussion on [Release] A text editor within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
[Release] A text editor

No, not privateserver related at all.

Can be good for editing textfiles, all it does is find something and then replace it, for example you want to change names in a loong story, you insert the old name and then new name, and you're good to go!

This time I will include sourcecode.

Form.cs code:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace QuicknEasy_TextEditor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        OpenFileDialog browse = new OpenFileDialog();
        private void button1_Click(object sender, EventArgs e)
        {
            
            browse.Title = "Select a file";
            if (browse.ShowDialog() == DialogResult.Cancel)
                return;
            textBox3.Text = "Status: File selected.";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string Text = File.ReadAllText(browse.FileName);
            if (Text.Contains(textBox1.Text))
            {
                Text = Text.Replace(textBox1.Text, textBox2.Text);
                File.WriteAllText(browse.FileName, Text);
                MessageBox.Show("Replacing text succeed!", "Success");
                textBox1.Text = "";
                textBox2.Text = "";
                textBox3.Text = "Status: No file selected";
                textBox4.Text = "  Find:";
                textBox5.Text = "  Replace:";
                browse = new OpenFileDialog();
                
            }
            else
                MessageBox.Show("Couldn't find the given text!", "Error");
        }
    }
}

Designer.cs code:
Code:
namespace QuicknEasy_TextEditor
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.textBox3 = new System.Windows.Forms.TextBox();
            this.textBox4 = new System.Windows.Forms.TextBox();
            this.textBox5 = new System.Windows.Forms.TextBox();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(12, 12);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(144, 23);
            this.button1.TabIndex = 0;
            this.button1.Text = "Browse file";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.Location = new System.Drawing.Point(12, 95);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(144, 23);
            this.button2.TabIndex = 1;
            this.button2.Text = "Replace with new text";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // textBox1
            // 
            this.textBox1.Location = new System.Drawing.Point(53, 43);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(144, 20);
            this.textBox1.TabIndex = 2;
            
            // 
            // textBox2
            // 
            this.textBox2.Location = new System.Drawing.Point(53, 69);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(144, 20);
            this.textBox2.TabIndex = 3;
            
            // 
            // textBox3
            // 
            this.textBox3.Location = new System.Drawing.Point(12, 124);
            this.textBox3.Name = "textBox3";
            this.textBox3.ReadOnly = true;
            this.textBox3.Size = new System.Drawing.Size(179, 20);
            this.textBox3.TabIndex = 4;
            this.textBox3.Text = "Status: No file selected.";
            // 
            // textBox4
            // 
            this.textBox4.Location = new System.Drawing.Point(-4, 43);
            this.textBox4.Name = "textBox4";
            this.textBox4.ReadOnly = true;
            this.textBox4.Size = new System.Drawing.Size(57, 20);
            this.textBox4.TabIndex = 5;
            this.textBox4.Text = "  Find:";
            
            // 
            // textBox5
            // 
            this.textBox5.Location = new System.Drawing.Point(-4, 69);
            this.textBox5.Name = "textBox5";
            this.textBox5.ReadOnly = true;
            this.textBox5.Size = new System.Drawing.Size(57, 20);
            this.textBox5.TabIndex = 6;
            this.textBox5.Text = "  Replace:";
         
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(208, 157);
            this.Controls.Add(this.textBox5);
            this.Controls.Add(this.textBox4);
            this.Controls.Add(this.textBox3);
            this.Controls.Add(this.textBox2);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "QuicknEasy TextEditor";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.TextBox textBox3;
        private System.Windows.Forms.TextBox textBox4;
        private System.Windows.Forms.TextBox textBox5;
    }
}


Blah.
Attached Files
File Type: rar QuicknEasy.rar (15.0 KB, 23 views)
_Emme_ is offline  
Thanks
3 Users
Old 03/16/2009, 18:12   #2
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
nice work emme
coreymills is offline  
Old 03/16/2009, 18:25   #3
 
xxFastBoy's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 145
Received Thanks: 8
Looking Sweet thansk For Src Codes
xxFastBoy is offline  
Old 03/16/2009, 20:00   #4
 
Beta Limit's Avatar
 
elite*gold: 0
Join Date: Dec 2008
Posts: 493
Received Thanks: 72
I've gotta say; Your naming conventions suck ****, and you have no notes.
If you are going to release something at least make notes on what parts of it do.
It may all make perfect sense to you but that doesn't help anyone else.

Other than that - Nice release
Beta Limit is offline  
Old 03/16/2009, 21:37   #5
 
elite*gold: 0
Join Date: Nov 2006
Posts: 160
Received Thanks: 15
#request close.. not related to pservers

a.k.a Co2 PServers & Discussions

this aint general programming
rubenz is offline  
Old 03/17/2009, 00:54   #6
 
damianpesta's Avatar
 
elite*gold: 0
Join Date: Jan 2007
Posts: 1,034
Received Thanks: 58
Quote:
Originally Posted by rubenz View Post
#request close.. not related to pservers

a.k.a Co2 PServers & Discussions

this aint general programming
Stop being such a ****, let it go hes sharing codes so we can at least learn a basic coding hes doing ... If you dont like it , stay out of there n keep ur mouth shut.
damianpesta is offline  
Old 03/17/2009, 03:36   #7


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
/request move to programming forum (yes there is one for general programming)
Korvacs is offline  
Old 03/17/2009, 04:30   #8
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Can't you just use Ctrl+H in notepad to replace things? =P
kinshi88 is offline  
Reply


Similar Threads Similar Threads
Wie kann ich mit AutoIt einen text aus dem Editor auslesen???
04/06/2010 - AutoIt - 4 Replies
Hallo. Ich möchte gerne wissen wie ich mit AutoIt Text aus dem editor auslesen kann, zb.steht im editor: Hallo So das skript soll jetzt das wort Hallo in sich einbauen. Das mit dem ausgeben weiß ich, dass habe ich so gemacht: Send("Hier ebent das was ich ausgeben will.")
[Release] NPC Text Tool
04/27/2009 - EO PServer Guides & Releases - 15 Replies
hey all, i decided to make this since i was adding some translations my players did for me and they did it all with spaces ending in me getting sick of adding ~ so i spent 5 mins and made this :D this is coded in C# (.net runtime 3.5) http://i230.photobucket.com/albums/ee313/hio77/np cTextTool.jpg



All times are GMT +1. The time now is 05:24.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.