Question

Develop an application in C#, which stores and manages your favorite web bookmarks. In this application...

Develop an application in C#, which stores and manages your favorite web bookmarks. In this application the user should be able to display the list of all current bookmarks, as well as add, edit, or remove bookmarks from the list. Each bookmark consists of its title, URL address and, description. The list of bookmarks should be saved in secondary storage, in order not to be lost after the application is closed . Therefore, each time it is started, the application loads all bookmarks from a file. Also, the user should have the choice to save the current list of bookmarks to the file any time. The user interface is requested to be graphical.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output will be like:

Code will be like:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;

namespace BookmarkMaintenanceForm
{
public partial class Form1 : Form
{

List<string> list = new List<string>();
string oldItem;


public Form1()
{
InitializeComponent();

using (StreamReader reader = new StreamReader("..\\..\\TextFile1.txt"))
{
while (true)
{
string line = reader.ReadLine();
if (line == null)
{
break;
}
list.Add(line);
  
}
}


for (int i = 0; i < list.Count; i++)
{
listBox1.Items.Add(list[i]);

}

}

private void button4_Click(object sender, EventArgs e)
{

using (StreamWriter writer = new StreamWriter("..\\..\\TextFile1.txt"))
{
for (int i = 0; i < list.Count;i++ )
{
writer.WriteLine(list[i]);

}

}
  
  
  
this.Close();
}

private void button1_Click(object sender, EventArgs e)
{
list.Add(textBox1.Text);

listBox1.Items.Clear();

for (int i = 0; i < list.Count; i++)
{
listBox1.Items.Add(list[i]);

}

}

private void button2_Click(object sender, EventArgs e)
{
try
{
  
listBox1.Items.Add(textBox2.Text);
textBox2.Text = "";
listBox1.Items.Remove(oldItem);

}
catch
{
MessageBox.Show("Select item to edit");
}
  
  
}

  
private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();

  
list.Remove(textBox2.Text);

for (int i = 0; i < list.Count; i++)
{
listBox1.Items.Add(list[i]);

}

textBox2.Text = "";
}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
textBox2.Text = listBox1.SelectedItem.ToString();

oldItem = textBox2.Text;

}
catch
{
MessageBox.Show("Select item to edit");
}

}
}
}

Note: Try closing the application through close button in UI, It will write all the list item to the file again.

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
Develop an application in C#, which stores and manages your favorite web bookmarks. In this application...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • *Use Java to create this program* For this assignment, you will be building a Favorite Songs...

    *Use Java to create this program* For this assignment, you will be building a Favorite Songs application. The application should have a list with the items displayed, a textbox for adding new items to the list, and four buttons: Add, Remove, Load, and Save. The Add button takes the contents of the text field (textbox) and adds the item in it to the list. Your code must trim the whitespace in front of or at the end of the input...

  • Create a Web application that stores name and ID into an array. The GUI should asked...

    Create a Web application that stores name and ID into an array. The GUI should asked the user to enter a last name, a first name, and an ID. Make it sure that the inputs are valid: names contain only letters and ID 6-digit number. Add to buttons to the interface: Add button to insert the inputs into an array, and a Show button to list all the inputs.

  • Online Virtual lab is a web based application which will provide a simulation to the e-learning...

    Online Virtual lab is a web based application which will provide a simulation to the e-learning students to enhance their degree of excellence in distance learning education and to improve their practical skills related to science and technology fields. This web application will give an online laboratory environment, where an e-Learner performs practical work. This solution overcomes the problems faced in rural areas due to insufficient time and practical instruments/apparatus used in science laboratories. It is also beneficial for enhancing...

  • PYTHON PROGRAMMING NEED HELP ASAP You will write an application to manage music collections -- a music collection is a l...

    PYTHON PROGRAMMING NEED HELP ASAP You will write an application to manage music collections -- a music collection is a list of albums. The named tuples used for Albums and Songs are defined below, and an example of a music collection is given. (DO NOT HARDCODE THE VALUES FOR MUSIC!) Album = namedtuple('Album', 'id artist title year songs') Song = namedtuple('Song', 'track title length play_count') MUSIC = [ Album("1", "Peter Gabriel", "Up", 2002, [Song(1, "Darkness", 411, 5), Song(2, "Growing Up",...

  • DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to...

    DESCRIPTION Create a C++ program to manage phone contacts. The program will allow the user to add new phone contacts, display a list of all contacts, search for a specific contact by name, delete a specific contact. The program should provide the user with a console or command line choice menu about possible actions that they can perform. The choices should be the following: 1. Display list of all contacts. 2. Add a new contact. 3. Search for a contact...

  • Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbsche...

    Solve the code below: CODE: """ Code for handling sessions in our web application """ from bottle import request, response import uuid import json import model import dbschema COOKIE_NAME = 'session' def get_or_create_session(db): """Get the current sessionid either from a cookie in the current request or by creating a new session if none are present. If a new session is created, a cookie is set in the response. Returns the session key (string) """ def add_to_cart(db, itemid, quantity): """Add an...

  • 1.What registry key stores information that determines which application is opened when a user double-clicks a...

    1.What registry key stores information that determines which application is opened when a user double-clicks a file? Select one: a. HKEY_CLASSES_ROOT b. HKEY_USERS c. HKEY_CURRENT_USER d. HKEY_LOCAL_MACHINE 2.If you need to find the model and speed of the installed processor and hard drive and the amount of memory installed, what utility should you open? Select one: a. Task Manager b. msinfo32.exe c. Event Viewer d. msconfig.exe 3.What Windows utility is used to control the Windows and third-party services installed on...

  • Match each of these tasks with the classes that perform them. Some answers may be used...

    Match each of these tasks with the classes that perform them. Some answers may be used more than once. Obtain a task request to be sent from a different thread A. Message Queue and to be performed by this thread. B. Message Accept a new task request, then store it in another class C. Handler until this thread has time to perform the task. D. Looper Remove the top task request from the class that is storing it when the...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • PROGRAMING IN C. PLEASE HELP FIX MY CODE TO FIT THE FOLLOWING CRITERIA: 1.)Read your stocks...

    PROGRAMING IN C. PLEASE HELP FIX MY CODE TO FIT THE FOLLOWING CRITERIA: 1.)Read your stocks from your mystocks.txt file. You can use this information for the simulator. 2.)The stock price simulator will return the current price of the stock. The current prices is the prices of the requested ticker + a random number. 3.)We will assume that the stock price remains constant after the price check till your trade gets executed. Therefore, a buy or a sell order placed...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT