Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Top Posters

Who's Online (0)

Powered by Vanilla. Made with Bootstrap.
[UK Students] UCAS Personal Statement Helper
  • Sh3llc0d3
    Posts: 1,910
    Note: not hacking related lol.

    All UK students who want to go to University have to apply through UCAS.com and part of the process is writing a personal statement with a strict character limit. This programs forms a template for a personal statement and allows you to save [as a txt file] and load [ish] any saved draft copies. I will be adding a char limiter to the program but any UK students are welcome to improve or use it if you wish.

    [align=center]
    labels *6
    textbox *4
    buttons *5
    openfiledialog
    savefiledialog
    timer
    [/align]

    as you can see the 'about' button has no code but i'm sure you can edit yourselves. No instruction is given on what code fits what, you'll probably be able to guess.

    [align=center]http://i56.tinypic.com/8yt8vq.png[/align]

    Imports System.IO
    Imports System

    Public Class Form1
    Dim file As Stream

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Timer1.Stop()
    Me.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim sReader As StreamReader
    OpenFileDialog1.CheckFileExists = True
    OpenFileDialog1.CheckPathExists = True
    OpenFileDialog1.DefaultExt = \"txt\"
    OpenFileDialog1.FileName = \"\"
    OpenFileDialog1.Filter = \"Text Files (*.txt)|*.txt|All Files (*.*)|*.*\"
    OpenFileDialog1.Multiselect = False

    If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
    sReader = New StreamReader(OpenFileDialog1.FileName, True)
    'TextBox1.Text = oReader.ReadToEnd
    Dim section As Integer
    section = 0

    For Each line As String In sReader.ReadToEnd().Split(vbNewLine)
    If line.Trim() = \"------------ ------------\" Then
    section = section + 1
    Else
    If section = 0 Then
    TextBox1.AppendText(line)
    ElseIf section = 1 Then
    TextBox2.AppendText(line)
    ElseIf section = 2 Then
    TextBox3.AppendText(line)
    ElseIf section = 3 Then
    TextBox4.AppendText(line)
    End If
    End If
    Next
    End If

    End Sub

    Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    TextBox1.Text = \" \"
    TextBox2.Text = \" \"
    TextBox3.Text = \" \"
    TextBox4.Text = \" \"
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    SaveFileDialog1.DefaultExt = \"txt\"
    SaveFileDialog1.FileName = \"\"
    SaveFileDialog1.Filter = \"Text Files (*.txt)|*.txt|All Files (*.*)|*.*\"



    If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
    Dim sWriter As StreamWriter
    sWriter = New StreamWriter(SaveFileDialog1.FileName, True)
    sWriter.WriteLine(TextBox1.Text)
    sWriter.WriteLine(\"------------ ------------\")
    sWriter.WriteLine(TextBox2.Text)
    sWriter.WriteLine(\"------------ ------------\")
    sWriter.WriteLine(TextBox3.Text)
    sWriter.WriteLine(\"------------ ------------\")
    sWriter.WriteLine(TextBox4.Text)
    sWriter.WriteLine(\"------------ ------------\")
    sWriter.WriteLine(\"Last Saved On: \" + My.Computer.Clock.LocalTime)
    sWriter.Close()
    End If
    End Sub

    Private Sub ps_helper_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Label6.Text = My.Computer.Clock.LocalTime.ToString
    Timer1.Interval = 1000
    Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Label6.Text = My.Computer.Clock.LocalTime.ToString
    End Sub
    End Class



    Anyway I thought it was interesting how I loaded the file back to the form. Took a whole lesson to code lol. Hope it helps someone :)
    S-P
  • Xin
    Posts: 3,251
    Good job mate :) you writing your statement?
    Xin
  • Sh3llc0d3
    Posts: 1,910
    said:


    Good job mate :) you writing your statement?



    Yeah, well finished it already. I'm sending mine off for my tutor to write his reference after half term. It's going to be a real fight for places this year and we've all been told we need to get applications ready for around the start of November.
  • Xin
    Posts: 3,251
    said:


    said:


    Good job mate :) you writing your statement?



    Yeah, well finished it already. I'm sending mine off for my tutor to write his reference after half term. It's going to be a real fight for places this year and we've all been told we need to get applications ready for around the start of November.


    Where you apply to and what coursE:?
    Xin