Basic Notepad Coding

broken image


  1. Notepad Coding Html
  2. Coding Using Notepad

Whoever says that Notepad is a boring application is wrong! Today, we will tell you really cool Notepad tricks that you can play with the help of your long-time companion, the Windows Notepad. A simple text editor like Notepad may not be the favorite of programmers but the same programmers are giving you codes that will make for an amazing demonstration.

As you know, Notepad is a plain text editor that creates .txt files. Text typed in this tiny application is not formatted and can be easily exported to any other text editor. Although .txt is the default file extension of Notepad, it can also open files with several other extensions. One of the really good use of Notepad is to remove formatting (created by MS-Word or HTML Web pages) and get completely plain text. But there are a lot of other interesting things that you can do with this little magic! Let's learn!

1. Notepad Code for Matrix Style Raining Code

  • Microsoft's Basic Programming Platform. XML Notepad 2007 is a free Development and IT software created by Microsoft. The software allows users to browse and edit their XML documents through a very.
  • Modern web technologies used in web templates, including HTML CSS JavaScript, and bootstrap, allow the transformation of the basic. To begin coding HTML.

Notepad in VB.Net with Full Source Code. This Notepad is a simple computer application that is made up of VB.Net.It is very easy to use applications because the functions can be easily operate by any users. This is a simple project that beginners in programming won't find difficulty in dealing with this project. I have heard people saying about notepad on windows but what is notepad? Vb code to write into Notepad text file. (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

Remember posters of The Matrix movie? Green colored letters falling from top to bottom on a black background. You can create a similar never-ending effect using a simple Notepad trick.

  1. Copy the code given below and paste it in a Notepad file
  2. Save the file as matrix.bat
  3. Double click the saved file and see the effect

The Code

@echo off
color 02
:start
echo %random% %random% %random% %random% %random% %random% %random% %random% %random% %random%
goto start

How it works?

When you save a file with .bat extension, it becomes an executable file. When you open such a file, your computer runs the program code saved in the file. The above give code creates randomly generated numbers and paint them green colored. This program will keep on generating random numbers until you close the command prompt window.

TIP 1: You can change the color of falling text by changing color 02 to, for example, color 03. Try using different values and see which colors your like!

TIP 2: A more accurate Matrix Raining Code effect can be created with the following code. Try it out. It's been taken from WikiHow:

@echo off
:a
color 2
echo 1 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 1 1 1 1
ping localhost -n 1 > nul
echo 1 1 0 1 1 1 0 0 0 1 0 1 a f h 0 0 0 1 0 1 1 0 0 1 1 1 0 0 1 0 1 0 0 1 1 0
echo 1 0 0 1 1 0 9 8 1 2 0 1 9 9 2 1 1 1 0 0 1 0 1 1 1 0 1 1 0 1 0 0 0 1 0 1 1
ping localhost -n 1 > nul
echo 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 0 0 01 0 1 0 0 1 0
ping localhost -n 1 > nul
echo 1 0 1 1 1 0 1 1 0 9 1 1 2 1 1 0 9 1 0 5 7 7 8 7 8 1 3 2 1 2 1 2 3 2 1 3 4
ping localhost -n 1 > nul
echo 1 1 1 0 1 0 0 1 0 0 0 1 1 1 0 0 1 1 1 4 1 2 1 1 2 0 1 0 1 2 2 1 0 1 1 0 1
goto a

2. Shutdown Computer with a Message using Notepad Code

What if you could easily shut down your computer and also get it to say good night to you! You can set it up very easily. Copy the following code in Notepad and save the file as shutdown.bat (in fact you can use any name, just keep the .bat extension)

@echo off
msg * Computer will now shut down
shutdown -c 'Good night. Sleep well!' -s

When you will open this file; your computer will prompt you that it will shutdown now. If you say OK, it will.

3. Create a Log (Diary) using Notepad

If you have the habit of regularly taking notes in a Notepad file, this feature will be of great use to you. This feature of Notepad will automatically add date and time when you'll close the file.

  1. Create a new Notepad file
  2. Type .LOG in the first line and then save the file as log.txt
  3. Now, open the file again and you will see that there would be an extra line at the end. This line will tell you the time when you last closed this Notepad file.
  4. Write something and again close the file. Notepad will add another timestamp.

4. Text to Speech using Notepad

A small piece of Notepad code can allows you to create an application that will read out aloud whatever text you will give it as input. This feature really comes handy if you quickly want to convert a piece of text into spoken words.

  1. Open Notepad and copy-paste the following code in it
    Dim message, sapi
    message=InputBox('What do you want me to say?','Speak')
    Set sapi=CreateObject('sapi.spvoice')
    sapi.Speak message
  2. Save the file as speak.vbs
  3. Double click on the saved file. A popup box will appear. Enter the text in this box and click the OK button.
  4. You will hear computer reading out your text. Make sure your speakers are on and speaker volume is enough!

5. Automatically Eject CD Drive

The following Notepad code can automatically eject CD drive of your computer and keep on doing it repeatedly. You can use this script to bother your friends a little bit if that sounds like fun. Add the following code in Notepad and save the file as opencd.vbs. Double click the saved file and see what happens.

Set oWMP = CreateObject('WMPlayer.OCX.7')
Set colCDROMs = oWMP.cdromCollection
do
if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count – 1
colCDROMs.Item(i).Eject
Next
For i = 0 to colCDROMs.Count – 1
colCDROMs.Item(i).Eject
Next
End If
wscript.sleep 5000
loop

Warning: Please note that this script will loop on and may cause the computer to hang.

6. Open Notepad Repeatedly

Add the following code in a new Notepad file and save it with .vbs extension. This code will keep on opening Notepad instances. As a result, your computer screen will be full of just Notepad windows.

@ECHO off
:top
START %SystemRoot%system32notepad.exe
GOTO top

Warning: This is another trick that may make your computer to hang. Computer may become too busy in opening more and more Notepad windows that it will hardly get any time to do anything else. So, try it with care!

7. Make Lock LEDs on Keyboard Dance

Every standard PC keyboard has three lock keys, namely Caps-lock, Num-lock and Scroll-lock. Each of these keys has an LED light on keyboard that shows the status of that lock. The following code can make these LED lights blink in a fashion so as to make them appear as dancing lights.

Open Notepad and add the following code in it. Save the file as led.vbs and when you will open this file, the LED light will begin to dance!

Set wshShell =wscript.CreateObject('WScript.Shell')
do
wscript.sleep 100
wshshell.sendkeys '{CAPSLOCK}'
wshshell.sendkeys '{NUMLOCK}'
wshshell.sendkeys '{SCROLLLOCK}'
loop

Warning: This trick may make your computer too busy to respond.

8. Bush Hid the Facts

Some of the older versions of Notepad have an interesting bug in it. Write four words of 4,3,3 and 5 letters and then save the file. When you will open this file again, instead of what you had written, you will see gibberish text. Following are some of the examples of such 4-3-3-5 sentences:

  1. Bush hid the facts
  2. Bill fed the goats
  3. This app can break

This happens because of a bug in Windows. However, in newer versions of Windows, this bug has been taken care of. You can give it a try to see what your computer shows!

9. World Trade Center Attack

This Notepad trick is basically a hoax. Nevertheless it produces interesting result.

  1. Open Notepad and type Q33N in it
  2. Go to Format > Font
  3. Change the Notepad font to Wingdings
  4. Set the font size to 72

When you do this, you get to see something that will remind you of the terrorist attack on twin World Trade Tower.

Wingdings is a font that has pictorial symbols instead of alphabetical letters.

10. Make Password Protected Folder using Notepad

This is probably the most useful Notepad code on the list. This trick creates a password protected private folder in your computer. Whatever you will place inside this folder will remain private until the opener provides a password.

Open Notepad and copy the following code in it:

@ECHO OFF
title Folder Private
if EXIST 'Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}' goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
echo Are you sure you want to lock the folder(Y/N)
set/p 'cho=>'
if %cho%Y goto LOCK
if %cho%y goto LOCK
if %cho%n goto END
if %cho%N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Private 'Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}'
attrib +h +s 'Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}'
echo Folder locked
goto End
:UNLOCK
echo Enter password to unlock folder
set/p 'pass=>'
if NOT %pass% techwelkin goto FAIL
attrib -h -s 'Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}'
ren 'Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}' Private
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Private
echo Private created successfully
goto End
:End

Save the file as private.bat and close Notepad.

Double click on private.bat file to open it. This will create a new folder called Private.

Place anything in it that you want to keep password-protected.

Close the password-protected folder. The next time you will open it, it will ask for a password. The password in the above code is techwelkin. We have highlighted the password in the above code. You can change it to anything you want in the the Notepad file. You should keep a strong password for added security (you can use our strong password generator).

These were some of the coolest Notepad codes and tricks. We will add more Notepad tricks in this list as and when we will discover them. We hope that this article was useful for you. Thank you for using TechWelkin!

In this tutorial you will learn how to make a basic website from scratch using Notepad. If you are on a Mac you need to use TextEdit.

There are other professional code editors that you can use to edit code like html

If you are on a Mac and you want something better than TextEdit, you can download Adobe Brackets which works on both Mac & Windows. I will be working on Windows and therefore using the basic version of Notepad. The code in this tutorial works in any editor so just pick an editor you like and let's begin.

Making your first page in Notepad

Windows
To open Notepad on Windows 7 or earlier, click on Start -> All Programs -> Accessories -> Notepad. You can also click on Start and search for 'Notepad'.

Mac
Open TextEdit and make sure the text editor is set to plain text by going to Preferences > New Document > select plain text. Next make sure to check 'Display html file as html code' and 'Display RTF file as RTF code' under 'Open and Save'.

Next copy and paste the following code into the editor:




My First Heading


My first paragraph.




Saving the HTML File

Save the file as 'index.html' with an HTML extension. This is very important if you don't add the .html to the end of the name, it won't work. Note: Even though .html is preferred you can also use .htm without the 'L'.

Set the Encoding to UTF-8, which is preferred for html files. ANSI encoding is only for US and Western European characters.

Opening HTML File in the Browser

Next, go to the folder where you've saved the file and open it in your browser. In this example we are using Chrome, but any modern browser should work.
NOTE: If you are having trouble opening the file, make sure you have saved it as .html.

Viewing HTML File in the Browser

Once the file is opened in your browser it will look like this:

Notice the file path in the URL Bar
file:///C:/Users/WebsitesDIY/Desktop/HTML/index.html
That is the full path to the file on your computer.

Centering the Text

Now that you understand the basics of creating an html file, let's learn how to center text

Go into the html file you have created and add the

tags around 'My First Heading' like so

My First Heading

Delete

My first paragraph.

for now.

Save the File and reopen it in the browser again. If your browser window is still open you can simply click refresh to reload the page.

The header text should now be centered in the middle of the web page.

Adding a Youtube video to your WebSite

To add a youtube video to your website: Go to Youtube and find the video you want to add to your website.
'Right Click' on the video and 'Copy Embed Code'.

Pasting the Video Embed Code into Notepad

Paste the embed code into Notepad

The embed code will looks something like this:
width='854'</span><span>height='480'</span> src='https://www.youtube.com/embed/Q8AZ16uBhr8' frameborder='0' allowfullscreen>

You can change the width and height to whatever you want. Just change those numbers in the code and leave everything else unchanged. In this example we will be using a width='427' and height='240'. You can set yours to whatever you want.

Center the Video by putting the

tag around the Embed Code you've copied from YouTube.

Also, lets change the heading between the

My First Heading

tags to say 'My Website'.

Adding a Link to another page

We will now add a link that goes to Google when people click on it.

Notepad Coding Html

Add the following code to your website just below the video:
Go to Google

Notice how the link is centered using the center tags. Also notice the
tag just before the center tag - this adds a line break between the video and the link.

You should now see a link below the video which goes to Google if you click on it.

You can create links that go to any page that you want. Just change what's in the href attribute.

Coding Using Notepad

If you want to open the link in a new window when someone clicks on it, add the following attribute in the link tag: target='_blank'>Go to Google

Creating a 2nd Page for your Website

Now, we are going to make a second page for your website and call it page2.html. This way you can create links to other parts of your website instead of linking to Google like we did earlier.

Create a new html file and add the below code to it. Save it and call it page2.html




Page 2


This is my 2nd page.




Your website will now have a second page that we can link to from the first page.

Linking to Page2 from your Main Page

Now that we have created Page2, lets modify the link on the first page to link to page2.html

Open up 'index.html' and change the URL that links to Google to link to Page 2 instead:

Page 2

You are now on page 2 of your website

If you have created your link successfully you should be taken to page.html when you click on the link below the video. If for some reason your link is not working, go back a few steps and follow the instructions again. Knowing how to add links/URLs to your website is very powerful. After all the internet is just a large collection of links indexed by Google.

Adding cool styles with CSS

We are now going to style the link to page2 using CSS so it looks like a button. CSS is used to control the layout of your website.
Copy and paste the following code at the top of your index.html page just below the tag. When pasting don't overwrite the other code.


<br /> a { <br /> display: inline-block;<br /> width: 100px;<br /> height: 30px;<br /> line-height: 30px;<br /> padding: 10px;<br /> background-color: #00AEEF;<br /> color: #ffffff;<br /> border-radius: 10px;<br /> }<br />

What this piece of code basically does is it tells the browser to add a background color and height to the link we made earlier. We also made the corners a little rounded by adding the border-radius of 10px. There are a lot of free tutorials online where you can learn more about CSS in order to make your website look really nice.

Adding a hover effect to the button

One last thing we are going to do is add a hover effect to the button. The hover effect will make the button turn a different color when you hover over it with your mouse.

Add the following code just above the closing tag:

a:hover {
background-color: #005170;
}

Your website should now look like this

Your website should now look like the example in the picture. There should be a header with the name at the top, a video in the middle and a button at the bottom. When you hover over the button with your mouse the color should change to a dark blue. If your website doesn't look right it's because you probably have errors in the code. Please go back a few steps and try again. It's important to understand the basics before going to the next step where we will show how to put your website on the internet so everyone can access it.

Going Live with your Website

In order for the world to see your website it needs to be uploaded to a webserver that stays connected to the internet 24/7. Now, we do not recommend setting up your own server. It's much easier to pay $3 or $5 a month to a professional webhosting provider to do this for you. I recomment using BlueHost and signing up for their Plus Planto launch your website and get a FREE domain name - this website is hosted on BlueHost and we love it. They are fast, secure and have great customer service.

Sign Up for WebHosting at BlueHost

How to Make a Website with WordPress
Step by Step Tutorial

Notepad

Now that you understand the basics of making a simple web page, I want to introduce you to WordPress - the most popular website builder in the world. Wordpress is Free Opensource software - which means you can download it and use it for free on as many website as you like. I have written a complete tutorial on how to set up your website with wordpress - read it here.
In this tutorial you will learn how to:

  • Get a Free Domain Name from BlueHost
  • Set Up your Own Hosting Account on BlueHost
  • Set up your website
  • Get Premium Themes/Template From ThemeForest

    • I hope you've found this guide helpfull. If you get stuck or have questions please join our community.





broken image