Skip to content

Instantly share code, notes, and snippets.

// this is the order of the fields for a book stored in a file
ISBN = 0;
AUTHORS_LAST_NAME = 1;
AUTHORS_FIRST_NAME = 2;
TITLE = 3;
PUBLICATION_YEAR = 4;
INDEX_PRICE = 5;
string recordIn;
private void removeButton_Click(object sender, EventArgs e)
{
if (removeIsbnRadioButton.Checked)
{
foreach (Book book in books)
{
if (book.Isbn.Normalize().Equals(searchBookTextBox.Text.Normalize()))
{
books.Remove(book);
break;
public void SavingFile()
{
StreamWriter writer = new StreamWriter("books.txt");
foreach (Book book in books)
{
writer.WriteLine(book.ToString());
}
}
public void SavingFile()
{
StreamWriter writer = new StreamWriter("books.txt");
foreach (Book book in books)
{
writer.WriteLine(book.ToString());
}
}
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;
//Nicole Buck
//Prog 109 Project 3
var bet = 0;
var credits = 100;
var count = 0;
var slotImages = new Array("lemon.png", "plum.png", "bell.png", "diamond.png", "clover.jpg");
public static void Roll()
{
Random r = new Random();
Random r2 = new Random();
int roll = r.Next(1, 7);
int roll2 = r2.Next(1, 7);
}
//label1.Text = roll.ToString();
CLASS
namespace DiceGame
{
class TwoDice
{
private static string filepath = @"C:\Users\Talia\Desktop\PROG 120\DiceGame\dice\";
private int value;
private Image image1;
private Image image2;
private void searchButton_Click(object sender, EventArgs e)
{
try
{
DataSet dataSet = new DataSet();
dataSet = BusinessEntities.PermitData.GetApplications(firstNameTextBox.Text, lastNameTextBox.Text);
searchJobsByNameDataGridView.DataSource = dataSet.Tables[0];
}
catch (Exception ex)
{
public int CompareTo(object obj)
{
if (obj is Book)
{
Book otherBook = (Book)obj;
if (this.Title != otherBook.Title)
{
return this.Title.CompareTo(otherBook.Title);
}
}