HomemadeTurbo - DIY Turbo Forum

HomemadeTurbo - DIY Turbo Forum (https://www.homemadeturbo.com/)
-   General Discussion (https://www.homemadeturbo.com/general-discussion-6/)
-   -   bored, wrote another program (https://www.homemadeturbo.com/general-discussion-6/bored-wrote-another-program-32046/)

stingray 12-23-2004 01:49 PM

bored, wrote another program
 
well, just starting to learn programming and i got bored and made a program that makes a list of titles, i use it for dvds, if anybody wants to check it out http://uploads.savefile.com/redir/62745.exe let me know if you find anything that doesnt work, and let me know if you think i should add something, just learning ---- on my own for now, till next term i get to start into learning ----

kain 12-23-2004 01:58 PM

Re:bored, wrote another program
 
what language do you use?

cus if its in c or c++ i could port it to linux.

stingray 12-23-2004 02:07 PM

Re:bored, wrote another program
 
its in visual basic, then i made an installation file from it, really wouldnt be worth porting to linux, its nothing to special


i used c++ for a long time, and now i have to take visual basic so im seeing what its like, getting used to it...

stingray 12-23-2004 02:09 PM

Re:bored, wrote another program
 
Imports System
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnDisplay As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button
Friend WithEvents lstList As System.Windows.Forms.ListBox
Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
Friend WithEvents btnDelete As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.btnDisplay = New System.Windows.Forms.Button
Me.btnAdd = New System.Windows.Forms.Button
Me.lstList = New System.Windows.Forms.ListBox
Me.MainMenu1 = New System.Windows.Forms.MainMenu
Me.MenuItem1 = New System.Windows.Forms.MenuItem
Me.MenuItem2 = New System.Windows.Forms.MenuItem
Me.MenuItem3 = New System.Windows.Forms.MenuItem
Me.MenuItem4 = New System.Windows.Forms.MenuItem
Me.btnDelete = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'btnDisplay
'
Me.btnDisplay.BackColor = System.Drawing.SystemColors.Control
Me.btnDisplay.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDisplay.Location = New System.Drawing.Point(344, 280)
Me.btnDisplay.Name = "btnDisplay"
Me.btnDisplay.Size = New System.Drawing.Size(288, 40)
Me.btnDisplay.TabIndex = 1
Me.btnDisplay.Text = "Display List"
'
'btnAdd
'
Me.btnAdd.BackColor = System.Drawing.SystemColors.Control
Me.btnAdd.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.Location = New System.Drawing.Point(8, 280)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(288, 40)
Me.btnAdd.TabIndex = 2
Me.btnAdd.Text = "Add DVD Title"
'
'lstList
'
Me.lstList.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lstList.ItemHeight = 19
Me.lstList.Location = New System.Drawing.Point(8, 8)
Me.lstList.Name = "lstList"
Me.lstList.Size = New System.Drawing.Size(624, 251)
Me.lstList.Sorted = True
Me.lstList.TabIndex = 3
'
'MainMenu1
'
Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem3})
'
'MenuItem1
'
Me.MenuItem1.Index = 0
Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem2})
Me.MenuItem1.Text = "&File"
'
'MenuItem2
'
Me.MenuItem2.Index = 0
Me.MenuItem2.Text = "E&xit"
'
'MenuItem3
'
Me.MenuItem3.Index = 1
Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem4})
Me.MenuItem3.Text = "&View"
'
'MenuItem4
'
Me.MenuItem4.Index = 0
Me.MenuItem4.Text = "T&ext File"
'
'btnDelete
'
Me.btnDelete.BackColor = System.Drawing.SystemColors.Control
Me.btnDelete.Font = New System.Drawing.Font("Times New Roman", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(176, 336)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(288, 40)
Me.btnDelete.TabIndex = 4
Me.btnDelete.Text = "Delete"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.ControlDarkDark
Me.ClientSize = New System.Drawing.Size(640, 385)
Me.Controls.Add(Me.btnDelete)
Me.Controls.Add(Me.lstList)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.btnDisplay)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Menu = Me.MainMenu1
Me.Name = "Form1"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n
Me.Text = "DVD Titles"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
lstList.Items.Clear()
Dim sr As IO.StreamReader = IO.File.OpenText("c:\program files\dvd_titles\dvd.txt")
Dim dvdtitle As String
readtext(dvdtitle, sr)
End Sub
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim sw As StreamWriter
Dim newdvd As String = InputBox("Enter new DVD title")
writetext(sw, newdvd)
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
Me.Close()
End Sub
Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
System.Diagnostics.Process.Start("c:\program files\dvd_titles\dvd.txt")
End Sub
Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click
Dim deletedvdtitle As String = InputBox("Enter dvd title to delete").ToUpper
Dim sr As StreamReader = IO.File.OpenText("c:\program files\dvd_titles\dvd.txt")
Dim dvdtitle As String
Dim sw As StreamWriter = IO.File.CreateText("c:\program files\dvd_titles\temp.txt")
Dim foundFlag As Boolean = False
deletedvd(deletedvdtitle, sr, dvdtitle, sw)
End Sub
Sub readtext(ByVal dvdtitle As String, ByVal sr As IO.StreamReader)
Do While (sr.Peek <> -1)
dvdtitle = (sr.ReadLine().ToUpper)
lstList.Items.Add(dvdtitle)
Loop
sr.Close()
End Sub
Sub writetext(ByVal sw As StreamWriter, ByVal newdvd As String)
sw = File.AppendText("c:\program files\dvd_titles\dvd.txt")
sw.WriteLine(newdvd)
sw.Flush()
sw.Close()
End Sub
Sub deletedvd(ByVal deletedvdtitle As String, ByVal sr As StreamReader, ByVal dvdtitle As String, ByVal sw As StreamWriter)
Do While (sr.Peek <> -1)
dvdtitle = (sr.ReadLine).ToUpper
If deletedvdtitle = dvdtitle Then
MsgBox("DVD title found and deleted")
Else
sw.WriteLine(dvdtitle)
sw.Flush()
End If
Loop
sr.Close()
File.Delete("c:\program files\dvd_titles\dvd.txt")
File.Copy("c:\program files\dvd_titles\temp.txt", "c:\program files\dvd_titles\dvd.txt")
sw.Close()
File.Delete("c:\program files\dvd_titles\temp.txt")
End Sub
End Class


there it is

spoon fed 12-23-2004 02:10 PM

Re:bored, wrote another program
 
???wtf???

SkunT 12-23-2004 02:13 PM

Re:bored, wrote another program
 

Originally Posted by spoon fed
???wtf???


no ----. this is homemadeturbo not computer programming one on one.

----, i dont even think i spelled programming right :P

PureCRXtasy 12-23-2004 02:15 PM

Re:bored, wrote another program
 
That's NOT even Visual Basic. That's the .NET crap MS decided to ruin VB in favor of.. Stay tuned kiddies..
more and more Bloatware to come..

stingray 12-23-2004 02:18 PM

Re:bored, wrote another program
 
holy ----, just tryin to see if everything came out right, lately this forums been going in the shitter, its like honda-tech all over again...

as far as .net crap, its a required course

FooK 12-23-2004 02:47 PM

Re:bored, wrote another program
 
geek

ShitBoxCivic 12-23-2004 05:18 PM

Re:bored, wrote another program
 

Originally Posted by FooK
geek



All times are GMT -5. The time now is 08:38 PM.


© 2024 MH Sub I, LLC dba Internet Brands