diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9088c8e --- /dev/null +++ b/.gitignore @@ -0,0 +1,253 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml \ No newline at end of file diff --git a/94/94-1(VB.net)/2009-07-18_234657.png b/94/94-1(VB.net)/2009-07-18_234657.png new file mode 100644 index 0000000..f53fa2d Binary files /dev/null and b/94/94-1(VB.net)/2009-07-18_234657.png differ diff --git "a/94/94-1(VB.net)/94-1/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" "b/94/94-1(VB.net)/94-1/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" new file mode 100644 index 0000000..2dd8b79 --- /dev/null +++ "b/94/94-1(VB.net)/94-1/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94} + WinExe + _94_1.My.MyApplication + _94_1 + 94-1 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 94-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 94-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/94/94-1(VB.net)/94-1/Form1.Designer.vb b/94/94-1(VB.net)/94-1/Form1.Designer.vb new file mode 100644 index 0000000..2d8cf79 --- /dev/null +++ b/94/94-1(VB.net)/94-1/Form1.Designer.vb @@ -0,0 +1,73 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(32, 38) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "加密" + Me.Button1.UseVisualStyleBackColor = True + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(12, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(450, 20) + Me.InputBox.TabIndex = 1 + Me.InputBox.Text = "abcabcabcabc" + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(12, 67) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(450, 20) + Me.OutputBox.TabIndex = 2 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(478, 95) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "94年工科技藝競賽第1題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + +End Class diff --git a/94/94-1(VB.net)/94-1/Form1.resx b/94/94-1(VB.net)/94-1/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/94/94-1(VB.net)/94-1/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-1(VB.net)/94-1/Form1.vb b/94/94-1(VB.net)/94-1/Form1.vb new file mode 100644 index 0000000..8a5b4bf --- /dev/null +++ b/94/94-1(VB.net)/94-1/Form1.vb @@ -0,0 +1,39 @@ +Public Class Form1 + Dim StrAry() As String = {"a", "b", "c", "d", "f", "g", "h", "i", "j"} + Dim DataAry(,) As Integer = New Integer(,) {{1, 9, 12, 33, 47, 53, 67, 78, 92, 0, 0, 0, 0, 0}, _ + {1, 48, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 13, 41, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 1, 3, 45, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 14, 16, 24, 44, 46, 55, 57, 64, 74, 82, 87, 98, 0}, _ + {1, 10, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 6, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 23, 39, 50, 56, 65, 68, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 32, 70, 73, 83, 88, 93, 0, 0, 0, 0, 0, 0, 0}, _ + {1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + For i = 0 To 9 + DataAry(i, 0) = 1 + Next + Dim OutString As String = "" + For i = 1 To InputBox.Text.Length + OutString += Encoding(Mid(InputBox.Text, i, 1)) & " " + Next + OutputBox.Text = OutString + End Sub + Private Function Encoding(ByVal data As String) As String + Dim n As Integer = Asc(data) - 97 + Dim index As Integer = DataAry(n, 0) + If DataAry(n, index) <> 0 Then + DataAry(n, 0) += 1 + Encoding = Str(DataAry(n, index)) + Else + DataAry(n, 0) = 2 + Encoding = Str(DataAry(n, 1)) + End If + Encoding = Trim(Encoding) + While Len(Encoding) < 2 + Encoding = "0" & Encoding + End While + End Function +End Class diff --git a/94/94-1(VB.net)/94-1/My Project/Application.Designer.vb b/94/94-1(VB.net)/94-1/My Project/Application.Designer.vb new file mode 100644 index 0000000..4fefe2e --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._94_1.Form1 + End Sub + End Class +End Namespace diff --git a/94/94-1(VB.net)/94-1/My Project/Application.myapp b/94/94-1(VB.net)/94-1/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/94/94-1(VB.net)/94-1/My Project/AssemblyInfo.vb b/94/94-1(VB.net)/94-1/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..0dddb61 --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/94/94-1(VB.net)/94-1/My Project/Resources.Designer.vb b/94/94-1(VB.net)/94-1/My Project/Resources.Designer.vb new file mode 100644 index 0000000..0f940ed --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_94_1.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/94/94-1(VB.net)/94-1/My Project/Resources.resx b/94/94-1(VB.net)/94-1/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-1(VB.net)/94-1/My Project/Settings.Designer.vb b/94/94-1(VB.net)/94-1/My Project/Settings.Designer.vb new file mode 100644 index 0000000..b5ce865 --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._94_1.My.MySettings + Get + Return Global._94_1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/94/94-1(VB.net)/94-1/My Project/Settings.settings b/94/94-1(VB.net)/94-1/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/94/94-1(VB.net)/94-1/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/94/94-1(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" "b/94/94-1(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" new file mode 100644 index 0000000..977f2b2 --- /dev/null +++ "b/94/94-1(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "94年工科技藝競賽第1題", "94-1\94年工科技藝競賽第1題.vbproj", "{C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C622CA9E-BDCA-4FCB-A11A-20E9CCF9AF94}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/94/94-2(VB.net)/2009-07-18_234629.png b/94/94-2(VB.net)/2009-07-18_234629.png new file mode 100644 index 0000000..f5f1efe Binary files /dev/null and b/94/94-2(VB.net)/2009-07-18_234629.png differ diff --git "a/94/94-2(VB.net)/94-2/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" "b/94/94-2(VB.net)/94-2/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" new file mode 100644 index 0000000..a05d01a --- /dev/null +++ "b/94/94-2(VB.net)/94-2/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {D297D924-C891-4DA5-B032-399CA65A62AF} + WinExe + _94_2.My.MyApplication + _94_2 + 94-2 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 94-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 94-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/94/94-2(VB.net)/94-2/Form1.Designer.vb b/94/94-2(VB.net)/94-2/Form1.Designer.vb new file mode 100644 index 0000000..a8efce7 --- /dev/null +++ b/94/94-2(VB.net)/94-2/Form1.Designer.vb @@ -0,0 +1,241 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.PictureBox1 = New System.Windows.Forms.PictureBox + Me.PictureBox2 = New System.Windows.Forms.PictureBox + Me.Button2 = New System.Windows.Forms.Button + Me.PictureBox4 = New System.Windows.Forms.PictureBox + Me.Button4 = New System.Windows.Forms.Button + Me.PictureBox3 = New System.Windows.Forms.PictureBox + Me.Button3 = New System.Windows.Forms.Button + Me.PictureBox5 = New System.Windows.Forms.PictureBox + Me.Button5 = New System.Windows.Forms.Button + Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(12, 12) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "載入影像1" + Me.Button1.UseVisualStyleBackColor = True + ' + 'PictureBox1 + ' + Me.PictureBox1.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.PictureBox1.Location = New System.Drawing.Point(12, 41) + Me.PictureBox1.Name = "PictureBox1" + Me.PictureBox1.Size = New System.Drawing.Size(254, 212) + Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox1.TabIndex = 1 + Me.PictureBox1.TabStop = False + ' + 'PictureBox2 + ' + Me.PictureBox2.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.PictureBox2.Location = New System.Drawing.Point(12, 288) + Me.PictureBox2.Name = "PictureBox2" + Me.PictureBox2.Size = New System.Drawing.Size(254, 212) + Me.PictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox2.TabIndex = 3 + Me.PictureBox2.TabStop = False + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(12, 259) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "載入影像2" + Me.Button2.UseVisualStyleBackColor = True + ' + 'PictureBox4 + ' + Me.PictureBox4.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.PictureBox4.Location = New System.Drawing.Point(284, 288) + Me.PictureBox4.Name = "PictureBox4" + Me.PictureBox4.Size = New System.Drawing.Size(254, 212) + Me.PictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox4.TabIndex = 7 + Me.PictureBox4.TabStop = False + ' + 'Button4 + ' + Me.Button4.Location = New System.Drawing.Point(284, 259) + Me.Button4.Name = "Button4" + Me.Button4.Size = New System.Drawing.Size(107, 23) + Me.Button4.TabIndex = 6 + Me.Button4.Text = "載入影像2灰階" + Me.Button4.UseVisualStyleBackColor = True + ' + 'PictureBox3 + ' + Me.PictureBox3.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.PictureBox3.Location = New System.Drawing.Point(284, 41) + Me.PictureBox3.Name = "PictureBox3" + Me.PictureBox3.Size = New System.Drawing.Size(254, 212) + Me.PictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox3.TabIndex = 5 + Me.PictureBox3.TabStop = False + ' + 'Button3 + ' + Me.Button3.Location = New System.Drawing.Point(284, 12) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(107, 23) + Me.Button3.TabIndex = 4 + Me.Button3.Text = "載入影像1灰階" + Me.Button3.UseVisualStyleBackColor = True + ' + 'PictureBox5 + ' + Me.PictureBox5.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.PictureBox5.Location = New System.Drawing.Point(558, 177) + Me.PictureBox5.Name = "PictureBox5" + Me.PictureBox5.Size = New System.Drawing.Size(254, 212) + Me.PictureBox5.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage + Me.PictureBox5.TabIndex = 9 + Me.PictureBox5.TabStop = False + ' + 'Button5 + ' + Me.Button5.Location = New System.Drawing.Point(558, 148) + Me.Button5.Name = "Button5" + Me.Button5.Size = New System.Drawing.Size(110, 23) + Me.Button5.TabIndex = 8 + Me.Button5.Text = "兩影像相減" + Me.Button5.UseVisualStyleBackColor = True + ' + 'OpenFileDialog1 + ' + Me.OpenFileDialog1.FileName = "OpenFileDialog1" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(229, 259) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(37, 13) + Me.Label1.TabIndex = 10 + Me.Label1.Text = "(圖一)" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(501, 259) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(37, 13) + Me.Label2.TabIndex = 11 + Me.Label2.Text = "(圖三)" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(229, 509) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(37, 13) + Me.Label3.TabIndex = 12 + Me.Label3.Text = "(圖二)" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(501, 509) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(37, 13) + Me.Label4.TabIndex = 13 + Me.Label4.Text = "(圖四)" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(775, 392) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(37, 13) + Me.Label5.TabIndex = 14 + Me.Label5.Text = "(圖五)" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(825, 531) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.PictureBox5) + Me.Controls.Add(Me.Button5) + Me.Controls.Add(Me.PictureBox4) + Me.Controls.Add(Me.Button4) + Me.Controls.Add(Me.PictureBox3) + Me.Controls.Add(Me.Button3) + Me.Controls.Add(Me.PictureBox2) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.PictureBox1) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "94年工科技藝競賽第2題" + CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox4, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox + Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents PictureBox4 As System.Windows.Forms.PictureBox + Friend WithEvents Button4 As System.Windows.Forms.Button + Friend WithEvents PictureBox3 As System.Windows.Forms.PictureBox + Friend WithEvents Button3 As System.Windows.Forms.Button + Friend WithEvents PictureBox5 As System.Windows.Forms.PictureBox + Friend WithEvents Button5 As System.Windows.Forms.Button + Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + +End Class diff --git a/94/94-2(VB.net)/94-2/Form1.resx b/94/94-2(VB.net)/94-2/Form1.resx new file mode 100644 index 0000000..710a648 --- /dev/null +++ b/94/94-2(VB.net)/94-2/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/94/94-2(VB.net)/94-2/Form1.vb b/94/94-2(VB.net)/94-2/Form1.vb new file mode 100644 index 0000000..9cd0151 --- /dev/null +++ b/94/94-2(VB.net)/94-2/Form1.vb @@ -0,0 +1,74 @@ +Public Class Form1 + Dim MyBitmap(5) As Bitmap + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + OpenFileDialog1.Filter = "tif files|*.tif|png files|*.png|jpg files|*.jpg|bmp files|*.bmp" + If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then + PictureBox1.ImageLocation = OpenFileDialog1.FileName + MyBitmap(1) = New Bitmap(OpenFileDialog1.FileName) + End If + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + OpenFileDialog1.Filter = "tif files|*.tif|png files|*.png|jpg files|*.jpg|bmp files|*.bmp" + If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then + PictureBox2.ImageLocation = OpenFileDialog1.FileName + MyBitmap(2) = New Bitmap(OpenFileDialog1.FileName) + End If + End Sub + + Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click + MyBitmap(3) = New Bitmap(MyBitmap(1).Width, MyBitmap(1).Height) + Dim flagGraphics As Graphics = Graphics.FromImage(MyBitmap(3)) + Dim pixelColor As Color + Dim MyPen As Pen = New Pen(pixelColor, 1.0F) + Dim ColorAvg As Integer + For i = 1 To MyBitmap(1).Width - 1 + For j = 1 To MyBitmap(1).Height - 1 + pixelColor = MyBitmap(1).GetPixel(i, j) + ColorAvg = (pixelColor.R / 3 + pixelColor.G / 3 + pixelColor.B / 3) + pixelColor = Color.FromArgb(ColorAvg, ColorAvg, ColorAvg) + MyPen.Color = pixelColor + flagGraphics.DrawLine(MyPen, i - 1, j, i + 1, j) + Next + Next + PictureBox3.Image = MyBitmap(3) + End Sub + + + Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click + MyBitmap(4) = New Bitmap(MyBitmap(2).Width, MyBitmap(2).Height) + Dim flagGraphics As Graphics = Graphics.FromImage(MyBitmap(4)) + Dim pixelColor As Color + Dim MyPen As Pen = New Pen(pixelColor, 1.0F) + Dim ColorAvg As Integer + For i = 1 To MyBitmap(2).Width - 1 + For j = 1 To MyBitmap(2).Height - 1 + pixelColor = MyBitmap(2).GetPixel(i, j) + ColorAvg = (pixelColor.R / 3 + pixelColor.G / 3 + pixelColor.B / 3) + pixelColor = Color.FromArgb(ColorAvg, ColorAvg, ColorAvg) + MyPen.Color = pixelColor + flagGraphics.DrawLine(MyPen, i - 1, j, i + 1, j) + Next + Next + PictureBox4.Image = MyBitmap(4) + End Sub + + Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click + MyBitmap(5) = New Bitmap(MyBitmap(3).Width, MyBitmap(3).Height) + Dim flagGraphics As Graphics = Graphics.FromImage(MyBitmap(5)) + Dim pixelColor1, pixelColor2 As Color + Dim MyPen As Pen = New Pen(pixelColor1, 1.0F) + For i = 1 To MyBitmap(3).Width - 1 + For j = 1 To MyBitmap(3).Height - 1 + pixelColor1 = MyBitmap(3).GetPixel(i, j) + pixelColor2 = MyBitmap(4).GetPixel(i, j) + If pixelColor1 <> pixelColor2 Then + MyPen.Color = pixelColor1 + flagGraphics.DrawLine(MyPen, i - 1, j, i + 1, j) + End If + Next + Next + PictureBox5.Image = MyBitmap(5) + End Sub +End Class diff --git a/94/94-2(VB.net)/94-2/My Project/Application.Designer.vb b/94/94-2(VB.net)/94-2/My Project/Application.Designer.vb new file mode 100644 index 0000000..29ca5d0 --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._94_2.Form1 + End Sub + End Class +End Namespace diff --git a/94/94-2(VB.net)/94-2/My Project/Application.myapp b/94/94-2(VB.net)/94-2/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/94/94-2(VB.net)/94-2/My Project/AssemblyInfo.vb b/94/94-2(VB.net)/94-2/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..fa70d84 --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/94/94-2(VB.net)/94-2/My Project/Resources.Designer.vb b/94/94-2(VB.net)/94-2/My Project/Resources.Designer.vb new file mode 100644 index 0000000..3b13d92 --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_94_2.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/94/94-2(VB.net)/94-2/My Project/Resources.resx b/94/94-2(VB.net)/94-2/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-2(VB.net)/94-2/My Project/Settings.Designer.vb b/94/94-2(VB.net)/94-2/My Project/Settings.Designer.vb new file mode 100644 index 0000000..8c201e2 --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._94_2.My.MySettings + Get + Return Global._94_2.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/94/94-2(VB.net)/94-2/My Project/Settings.settings b/94/94-2(VB.net)/94-2/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/94/94-2(VB.net)/94-2/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/94/94-2(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" "b/94/94-2(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" new file mode 100644 index 0000000..b819bdb --- /dev/null +++ "b/94/94-2(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "94年工科技藝競賽第2題", "94-2\94年工科技藝競賽第2題.vbproj", "{D297D924-C891-4DA5-B032-399CA65A62AF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D297D924-C891-4DA5-B032-399CA65A62AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D297D924-C891-4DA5-B032-399CA65A62AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D297D924-C891-4DA5-B032-399CA65A62AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D297D924-C891-4DA5-B032-399CA65A62AF}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/94/94-2(VB.net)/pic.rar b/94/94-2(VB.net)/pic.rar new file mode 100644 index 0000000..e846048 Binary files /dev/null and b/94/94-2(VB.net)/pic.rar differ diff --git a/94/94-3(VB.net)/2009-07-18_234505.png b/94/94-3(VB.net)/2009-07-18_234505.png new file mode 100644 index 0000000..7d75c31 Binary files /dev/null and b/94/94-3(VB.net)/2009-07-18_234505.png differ diff --git "a/94/94-3(VB.net)/94-3/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" "b/94/94-3(VB.net)/94-3/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" new file mode 100644 index 0000000..42d1fd4 --- /dev/null +++ "b/94/94-3(VB.net)/94-3/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6328252B-F527-451D-8760-7C91951F2771} + WinExe + _94_3.My.MyApplication + _94_3 + 94-3 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 94-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 94-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/94/94-3(VB.net)/94-3/Form1.Designer.vb b/94/94-3(VB.net)/94-3/Form1.Designer.vb new file mode 100644 index 0000000..498e76e --- /dev/null +++ b/94/94-3(VB.net)/94-3/Form1.Designer.vb @@ -0,0 +1,56 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.OutputBox = New System.Windows.Forms.RichTextBox + Me.SuspendLayout() + ' + 'OutputBox + ' + Me.OutputBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.OutputBox.Location = New System.Drawing.Point(0, 0) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.ReadOnly = True + Me.OutputBox.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None + Me.OutputBox.Size = New System.Drawing.Size(479, 358) + Me.OutputBox.TabIndex = 0 + Me.OutputBox.Text = "" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(471, 356) + Me.Controls.Add(Me.OutputBox) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.KeyPreview = True + Me.MaximizeBox = False + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "94年工科技藝競賽第3題" + Me.ResumeLayout(False) + + End Sub + Friend WithEvents OutputBox As System.Windows.Forms.RichTextBox + +End Class diff --git a/94/94-3(VB.net)/94-3/Form1.resx b/94/94-3(VB.net)/94-3/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/94/94-3(VB.net)/94-3/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-3(VB.net)/94-3/Form1.vb b/94/94-3(VB.net)/94-3/Form1.vb new file mode 100644 index 0000000..9b0e049 --- /dev/null +++ b/94/94-3(VB.net)/94-3/Form1.vb @@ -0,0 +1,101 @@ +Public Class Form1 + Dim InputData As String = "" + Dim IsStrat As Boolean = False + Dim DataAry(8, 8) As Integer + Const HORSE As Integer = 38 + Const NOWAY As Integer = 78 + Dim HorseX, HorseY As Integer + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + OutputBox.Text = "馬目前位置與一些障礙物:" + OutputBox.SelectionStart = OutputBox.TextLength + End Sub + Private Sub RichTextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles OutputBox.GotFocus + Me.Focus() + End Sub + + Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown + Select Case e.KeyData + Case Keys.D0 To Keys.D7 + InputData += Chr(e.KeyCode) + OutputBox.Text += Chr(e.KeyCode) + If IsStrat = True Then + OutputBox.Text += HandleData(Chr(e.KeyCode)) + InputData = "" + OutputBox.Text += vbCrLf & "輸入移動數字鍵:" + End If + Case Keys.Space + InputData += " " + OutputBox.Text += " " + Case Keys.Enter + Try + If IsStrat = False Then + IsStrat = True + Dim stmp() As String = InputData.Split(" ") + HorseY = Val(stmp(0)) + HorseX = Val(stmp(1)) + For i = 2 To UBound(stmp) Step 2 + DataAry(Val(stmp(i)), Val(stmp(i + 1))) = NOWAY + Next + OutputBox.Text += vbCrLf & "輸入移動數字鍵:" + End If + Catch ex As Exception + IsStrat = False + OutputBox.Text = "馬目前位置與一些障礙物:" + End Try + InputData = "" + Case Keys.Back + If InputData.Length > 0 Then + OutputBox.Text = Strings.Left(OutputBox.Text, OutputBox.TextLength - 1) + InputData = Strings.Left(InputData, InputData.Length - 1) + End If + Case Keys.D9 + End + End Select + OutputBox.SelectionStart = OutputBox.TextLength + End Sub + + Private Function HandleData(ByVal Data As String) As String + HandleData = vbCrLf & "馬移動到新位置:" + Select Case Data + Case "0" + HandleData += IsOK(2, 1, 1, 0) + Case "1" + HandleData += IsOK(2, -1, 1, 0) + Case "2" + HandleData += IsOK(1, -2, 0, -1) + Case "3" + HandleData += IsOK(-1, -2, 0, -1) + Case "4" + HandleData += IsOK(-2, -1, -1, 0) + Case "5" + HandleData += IsOK(-2, 1, -1, 0) + Case "6" + HandleData += IsOK(-1, 2, 0, 1) + Case "7" + HandleData += IsOK(1, 2, 0, 1) + End Select + End Function + + Private Function IsOK(ByVal x As Integer, ByVal y As Integer, ByVal w As Integer, ByVal h As Integer) As String + If IsIn(x, y) Then + If DataAry(HorseY + h, HorseX + w) <> NOWAY Then '注意這題的x跟y的位置跟平常是相反的 + HorseX += x + HorseY += y + DataAry(HorseY, HorseX) = 0 + IsOK = Str(HorseY) & Str(HorseX) + Else + IsOK = Str(HorseY) & Str(HorseX) & "(因馬腳梱住而保持原座標)" + End If + Else + IsOK = Str(HorseY) & Str(HorseX) & "(因超出棋盤外而保持原座標)" + End If + End Function + + Private Function IsIn(ByVal x As Integer, ByVal y As Integer) As Boolean + If HorseX + x > 8 Or HorseY + y > 8 Or HorseX + x < 1 Or HorseY + y < 1 Then + Return False + End If + Return True + End Function +End Class diff --git a/94/94-3(VB.net)/94-3/My Project/Application.Designer.vb b/94/94-3(VB.net)/94-3/My Project/Application.Designer.vb new file mode 100644 index 0000000..0eeae8a --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._94_3.Form1 + End Sub + End Class +End Namespace diff --git a/94/94-3(VB.net)/94-3/My Project/Application.myapp b/94/94-3(VB.net)/94-3/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/94/94-3(VB.net)/94-3/My Project/AssemblyInfo.vb b/94/94-3(VB.net)/94-3/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..28db6c8 --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/94/94-3(VB.net)/94-3/My Project/Resources.Designer.vb b/94/94-3(VB.net)/94-3/My Project/Resources.Designer.vb new file mode 100644 index 0000000..af5d586 --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_94_3.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/94/94-3(VB.net)/94-3/My Project/Resources.resx b/94/94-3(VB.net)/94-3/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-3(VB.net)/94-3/My Project/Settings.Designer.vb b/94/94-3(VB.net)/94-3/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1c2f504 --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._94_3.My.MySettings + Get + Return Global._94_3.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/94/94-3(VB.net)/94-3/My Project/Settings.settings b/94/94-3(VB.net)/94-3/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/94/94-3(VB.net)/94-3/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/94/94-3(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" "b/94/94-3(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" new file mode 100644 index 0000000..7fa5512 --- /dev/null +++ "b/94/94-3(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "94年工科技藝競賽第3題", "94-3\94年工科技藝競賽第3題.vbproj", "{6328252B-F527-451D-8760-7C91951F2771}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6328252B-F527-451D-8760-7C91951F2771}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6328252B-F527-451D-8760-7C91951F2771}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6328252B-F527-451D-8760-7C91951F2771}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6328252B-F527-451D-8760-7C91951F2771}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/94/94-4(VB.net)/2009-07-19_120321.png b/94/94-4(VB.net)/2009-07-19_120321.png new file mode 100644 index 0000000..bf145fe Binary files /dev/null and b/94/94-4(VB.net)/2009-07-19_120321.png differ diff --git "a/94/94-4(VB.net)/94-4/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" "b/94/94-4(VB.net)/94-4/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" new file mode 100644 index 0000000..280347b --- /dev/null +++ "b/94/94-4(VB.net)/94-4/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {196A7395-A0E0-4384-9446-82D494E5A4C6} + WinExe + _94_4.My.MyApplication + _94_4 + 94-4 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 94-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 94-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/94/94-4(VB.net)/94-4/Form1.Designer.vb b/94/94-4(VB.net)/94-4/Form1.Designer.vb new file mode 100644 index 0000000..4526a47 --- /dev/null +++ b/94/94-4(VB.net)/94-4/Form1.Designer.vb @@ -0,0 +1,73 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.InputBox = New System.Windows.Forms.RichTextBox + Me.Button1 = New System.Windows.Forms.Button + Me.OutputBox = New System.Windows.Forms.RichTextBox + Me.SuspendLayout() + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(12, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(195, 122) + Me.InputBox.TabIndex = 0 + Me.InputBox.Text = "100 1/5 0.8" & Global.Microsoft.VisualBasic.ChrW(10) & "100 1/5 0.9" & Global.Microsoft.VisualBasic.ChrW(10) & "80 1/5 0.8" & Global.Microsoft.VisualBasic.ChrW(10) & "80 1/5 0.9" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(12, 140) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "計算" + Me.Button1.UseVisualStyleBackColor = True + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(12, 169) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(195, 122) + Me.OutputBox.TabIndex = 2 + Me.OutputBox.Text = "" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(220, 303) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBox) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "94年工科技藝競賽第4題" + Me.ResumeLayout(False) + + End Sub + Friend WithEvents InputBox As System.Windows.Forms.RichTextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents OutputBox As System.Windows.Forms.RichTextBox + +End Class diff --git a/94/94-4(VB.net)/94-4/Form1.resx b/94/94-4(VB.net)/94-4/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/94/94-4(VB.net)/94-4/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-4(VB.net)/94-4/Form1.vb b/94/94-4(VB.net)/94-4/Form1.vb new file mode 100644 index 0000000..cfe8cf0 --- /dev/null +++ b/94/94-4(VB.net)/94-4/Form1.vb @@ -0,0 +1,13 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim DataAry() As String = InputBox.Text.Split(Chr(10)) + Dim StrTmp(), StrTmp2() As String + OutputBox.Text = "" + For i = 0 To UBound(DataAry) + StrTmp = DataAry(i).Split(" ") + StrTmp2 = StrTmp(1).Split("/") + OutputBox.Text += Format(Val(StrTmp(0)) * Val(StrTmp2(0)) / Val(StrTmp2(1)) / Val(StrTmp(2)), "0") & vbCrLf + Next + End Sub +End Class diff --git a/94/94-4(VB.net)/94-4/My Project/Application.Designer.vb b/94/94-4(VB.net)/94-4/My Project/Application.Designer.vb new file mode 100644 index 0000000..8b01da0 --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._94_4.Form1 + End Sub + End Class +End Namespace diff --git a/94/94-4(VB.net)/94-4/My Project/Application.myapp b/94/94-4(VB.net)/94-4/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/94/94-4(VB.net)/94-4/My Project/AssemblyInfo.vb b/94/94-4(VB.net)/94-4/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..34fc933 --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/94/94-4(VB.net)/94-4/My Project/Resources.Designer.vb b/94/94-4(VB.net)/94-4/My Project/Resources.Designer.vb new file mode 100644 index 0000000..95fc4b0 --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_94_4.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/94/94-4(VB.net)/94-4/My Project/Resources.resx b/94/94-4(VB.net)/94-4/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-4(VB.net)/94-4/My Project/Settings.Designer.vb b/94/94-4(VB.net)/94-4/My Project/Settings.Designer.vb new file mode 100644 index 0000000..a8cea5a --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._94_4.My.MySettings + Get + Return Global._94_4.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/94/94-4(VB.net)/94-4/My Project/Settings.settings b/94/94-4(VB.net)/94-4/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/94/94-4(VB.net)/94-4/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/94/94-4(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" "b/94/94-4(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" new file mode 100644 index 0000000..d16f9b9 --- /dev/null +++ "b/94/94-4(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "94年工科技藝競賽第4題", "94-4\94年工科技藝競賽第4題.vbproj", "{196A7395-A0E0-4384-9446-82D494E5A4C6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {196A7395-A0E0-4384-9446-82D494E5A4C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {196A7395-A0E0-4384-9446-82D494E5A4C6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {196A7395-A0E0-4384-9446-82D494E5A4C6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {196A7395-A0E0-4384-9446-82D494E5A4C6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/94/94-5(VB.net)/2009-07-19_120343.png b/94/94-5(VB.net)/2009-07-19_120343.png new file mode 100644 index 0000000..01d254d Binary files /dev/null and b/94/94-5(VB.net)/2009-07-19_120343.png differ diff --git "a/94/94-5(VB.net)/94-5/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" "b/94/94-5(VB.net)/94-5/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" new file mode 100644 index 0000000..f11e4d4 --- /dev/null +++ "b/94/94-5(VB.net)/94-5/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83} + WinExe + _94_5.My.MyApplication + _94_5 + 94-5 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 94-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 94-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/94/94-5(VB.net)/94-5/Form1.Designer.vb b/94/94-5(VB.net)/94-5/Form1.Designer.vb new file mode 100644 index 0000000..9b73fb3 --- /dev/null +++ b/94/94-5(VB.net)/94-5/Form1.Designer.vb @@ -0,0 +1,100 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.InputBox = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.Button1 = New System.Windows.Forms.Button + Me.OutputBox = New System.Windows.Forms.RichTextBox + Me.Label2 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'InputBox + ' + Me.InputBox.Font = New System.Drawing.Font("Courier New", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.InputBox.Location = New System.Drawing.Point(156, 23) + Me.InputBox.MaxLength = 3 + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(63, 29) + Me.InputBox.TabIndex = 0 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label1.Location = New System.Drawing.Point(48, 23) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(116, 20) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "輸入一整數N:" + ' + 'Button1 + ' + Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Button1.Location = New System.Drawing.Point(240, 23) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 32) + Me.Button1.TabIndex = 2 + Me.Button1.Text = "作答鈕" + Me.Button1.UseVisualStyleBackColor = True + ' + 'OutputBox + ' + Me.OutputBox.Font = New System.Drawing.Font("Courier New", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.OutputBox.Location = New System.Drawing.Point(12, 62) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(343, 199) + Me.OutputBox.TabIndex = 3 + Me.OutputBox.Text = "" + ' + 'Label2 + ' + Me.Label2.Location = New System.Drawing.Point(213, 7) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(155, 23) + Me.Label2.TabIndex = 4 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(367, 273) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "94年工科技藝競賽第5題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents OutputBox As System.Windows.Forms.RichTextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + +End Class diff --git a/94/94-5(VB.net)/94-5/Form1.resx b/94/94-5(VB.net)/94-5/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/94/94-5(VB.net)/94-5/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-5(VB.net)/94-5/Form1.vb b/94/94-5(VB.net)/94-5/Form1.vb new file mode 100644 index 0000000..697b491 --- /dev/null +++ b/94/94-5(VB.net)/94-5/Form1.vb @@ -0,0 +1,33 @@ +Public Class Form1 + Dim ErrorTotal As Integer = 0 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim InNumber As Integer = Val(InputBox.Text) + OutputBox.Text = "" + Label2.Text = "" + If InputBox.Text = "***" Then + ErrorTotal = 0 + InputBox.ForeColor = Color.Black + InputBox.Text = "" + ElseIf ErrorTotal > 3 Then + InputBox.ForeColor = Color.Red + InputBox.Text = " ???" + Label2.Text = "輸入錯誤超過3次" + ElseIf InNumber < 1 Or InNumber > 10 Then + Label2.Text = "輸入錯誤" + ErrorTotal += 1 + If ErrorTotal > 3 Then + Button1.PerformClick + End If + Else + For i = 1 To InNumber + OutputBox.Text += Strings.StrDup(InNumber - i, " ") + OutputBox.Text += Str(InNumber - i + 1) + For j = 2 To i + OutputBox.Text += " 1" + Next + OutputBox.Text += vbCrLf + Next + End If + End Sub +End Class diff --git a/94/94-5(VB.net)/94-5/My Project/Application.Designer.vb b/94/94-5(VB.net)/94-5/My Project/Application.Designer.vb new file mode 100644 index 0000000..aba99dc --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._94_5.Form1 + End Sub + End Class +End Namespace diff --git a/94/94-5(VB.net)/94-5/My Project/Application.myapp b/94/94-5(VB.net)/94-5/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/94/94-5(VB.net)/94-5/My Project/AssemblyInfo.vb b/94/94-5(VB.net)/94-5/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..faf8800 --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/94/94-5(VB.net)/94-5/My Project/Resources.Designer.vb b/94/94-5(VB.net)/94-5/My Project/Resources.Designer.vb new file mode 100644 index 0000000..99fd20b --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_94_5.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/94/94-5(VB.net)/94-5/My Project/Resources.resx b/94/94-5(VB.net)/94-5/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/94/94-5(VB.net)/94-5/My Project/Settings.Designer.vb b/94/94-5(VB.net)/94-5/My Project/Settings.Designer.vb new file mode 100644 index 0000000..900cb42 --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._94_5.My.MySettings + Get + Return Global._94_5.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/94/94-5(VB.net)/94-5/My Project/Settings.settings b/94/94-5(VB.net)/94-5/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/94/94-5(VB.net)/94-5/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/94/94-5(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" "b/94/94-5(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" new file mode 100644 index 0000000..91b0c22 --- /dev/null +++ "b/94/94-5(VB.net)/94\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "94年工科技藝競賽第5題", "94-5\94年工科技藝競賽第5題.vbproj", "{96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96856CA0-EE5A-4ED8-9A6F-D3AD594D5D83}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-1(VB.net)/2009-07-18_235523.png b/95/95-1(VB.net)/2009-07-18_235523.png new file mode 100644 index 0000000..ce1bd23 Binary files /dev/null and b/95/95-1(VB.net)/2009-07-18_235523.png differ diff --git "a/95/95-1(VB.net)/95-1/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" "b/95/95-1(VB.net)/95-1/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" new file mode 100644 index 0000000..b4fdd9b --- /dev/null +++ "b/95/95-1(VB.net)/95-1/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88} + WinExe + _95_1.My.MyApplication + _95_1 + 95-1 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-1(VB.net)/95-1/Form1.Designer.vb b/95/95-1(VB.net)/95-1/Form1.Designer.vb new file mode 100644 index 0000000..b7206de --- /dev/null +++ b/95/95-1(VB.net)/95-1/Form1.Designer.vb @@ -0,0 +1,99 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.Label1 = New System.Windows.Forms.Label + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox1 = New System.Windows.Forms.Label + Me.OutputBox2 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(51, 65) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(422, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "計算及產生質數個數" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(72, 29) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(91, 13) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "請輸入一正整數" + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(210, 25) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(100, 20) + Me.InputBox.TabIndex = 2 + Me.InputBox.Text = "10000" + ' + 'OutputBox1 + ' + Me.OutputBox1.AutoSize = True + Me.OutputBox1.Location = New System.Drawing.Point(72, 106) + Me.OutputBox1.Name = "OutputBox1" + Me.OutputBox1.Size = New System.Drawing.Size(67, 13) + Me.OutputBox1.TabIndex = 3 + Me.OutputBox1.Text = "質數個數有" + ' + 'OutputBox2 + ' + Me.OutputBox2.AutoSize = True + Me.OutputBox2.Location = New System.Drawing.Point(72, 137) + Me.OutputBox2.Name = "OutputBox2" + Me.OutputBox2.Size = New System.Drawing.Size(97, 13) + Me.OutputBox2.TabIndex = 4 + Me.OutputBox2.Text = "最大的3個質數是" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(538, 188) + Me.Controls.Add(Me.OutputBox2) + Me.Controls.Add(Me.OutputBox1) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第1題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox1 As System.Windows.Forms.Label + Friend WithEvents OutputBox2 As System.Windows.Forms.Label + +End Class diff --git a/95/95-1(VB.net)/95-1/Form1.resx b/95/95-1(VB.net)/95-1/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-1(VB.net)/95-1/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-1(VB.net)/95-1/Form1.vb b/95/95-1(VB.net)/95-1/Form1.vb new file mode 100644 index 0000000..b1d4107 --- /dev/null +++ b/95/95-1(VB.net)/95-1/Form1.vb @@ -0,0 +1,36 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim input As Long = Val(InputBox.Text) + Dim Max As Integer = 0 + For i = 2 To input + If IsPrime(i) Then + Max += 1 + End If + Next + OutputBox1.Text = "質數個數有 " & Str(Max) & " 個" + Dim prime(3), Num As Long + Num = 0 + OutputBox2.Text = "" + For i = input To 2 Step -1 + If IsPrime(i) Then + Num += 1 + OutputBox2.Text = Str(i) & OutputBox2.Text + If Num = 3 Then + Exit For + End If + End If + Next + OutputBox2.Text = "最大的3個質數是 " & OutputBox2.Text + + End Sub + Private Function IsPrime(ByVal n As Long) As Boolean + If n = 2 Or n = 3 Then Return True + Dim sqrtn = Math.Sqrt(n) + For i = 2 To sqrtn + If n Mod i = 0 Then Return False + Next + Return True + End Function + +End Class diff --git a/95/95-1(VB.net)/95-1/My Project/Application.Designer.vb b/95/95-1(VB.net)/95-1/My Project/Application.Designer.vb new file mode 100644 index 0000000..37927ef --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_1.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-1(VB.net)/95-1/My Project/Application.myapp b/95/95-1(VB.net)/95-1/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-1(VB.net)/95-1/My Project/AssemblyInfo.vb b/95/95-1(VB.net)/95-1/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..71eb253 --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-1(VB.net)/95-1/My Project/Resources.Designer.vb b/95/95-1(VB.net)/95-1/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f1b6f1e --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_1.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-1(VB.net)/95-1/My Project/Resources.resx b/95/95-1(VB.net)/95-1/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-1(VB.net)/95-1/My Project/Settings.Designer.vb b/95/95-1(VB.net)/95-1/My Project/Settings.Designer.vb new file mode 100644 index 0000000..d08776c --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_1.My.MySettings + Get + Return Global._95_1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-1(VB.net)/95-1/My Project/Settings.settings b/95/95-1(VB.net)/95-1/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-1(VB.net)/95-1/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-1(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" "b/95/95-1(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" new file mode 100644 index 0000000..e549993 --- /dev/null +++ "b/95/95-1(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第1題", "95-1\95年工科技藝競賽第1題.vbproj", "{6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ABD4D82-AC41-4D0D-84F0-C1827DCF4A88}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-2(VB.net)/2009-07-18_235504.png b/95/95-2(VB.net)/2009-07-18_235504.png new file mode 100644 index 0000000..13ce99a Binary files /dev/null and b/95/95-2(VB.net)/2009-07-18_235504.png differ diff --git "a/95/95-2(VB.net)/95-2/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" "b/95/95-2(VB.net)/95-2/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" new file mode 100644 index 0000000..078d8ff --- /dev/null +++ "b/95/95-2(VB.net)/95-2/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2} + WinExe + _95_2.My.MyApplication + _95_2 + 95-2 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-2(VB.net)/95-2/Form1.Designer.vb b/95/95-2(VB.net)/95-2/Form1.Designer.vb new file mode 100644 index 0000000..6edd3b8 --- /dev/null +++ b/95/95-2(VB.net)/95-2/Form1.Designer.vb @@ -0,0 +1,97 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.InputBox = New System.Windows.Forms.TextBox + Me.Button1 = New System.Windows.Forms.Button + Me.OutputBox = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(97, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(711, 20) + Me.InputBox.TabIndex = 0 + Me.InputBox.Text = "1101101011" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(97, 38) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(246, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "產生漢明碼" + Me.Button1.UseVisualStyleBackColor = True + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(97, 67) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(711, 20) + Me.OutputBox.TabIndex = 2 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 12) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(79, 13) + Me.Label1.TabIndex = 3 + Me.Label1.Text = "要計算的訊息" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(24, 70) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(67, 13) + Me.Label2.TabIndex = 4 + Me.Label2.Text = "產生的訊息" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(820, 105) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBox) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第2題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + +End Class diff --git a/95/95-2(VB.net)/95-2/Form1.resx b/95/95-2(VB.net)/95-2/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-2(VB.net)/95-2/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-2(VB.net)/95-2/Form1.vb b/95/95-2(VB.net)/95-2/Form1.vb new file mode 100644 index 0000000..c42ef61 --- /dev/null +++ b/95/95-2(VB.net)/95-2/Form1.vb @@ -0,0 +1,65 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim N As Integer = InputBox.Text.Length + Dim K As Integer = 1 + While True + If 2 ^ K >= N + K + 1 Then + Exit While + End If + K += 1 + End While + Dim XorNum As Integer = 0 + Dim OnFirst As Boolean = True + Dim Outputs As String = InputBox.Text + For i = 1 To K + If i <= 2 Then + Outputs += "A" + Else + Insert(Outputs, 2 ^ (i - 1) - 1, "A") + End If + Next + N = Outputs.Length + For i = 1 To N + If Mid(Outputs, i, 1) = "1" Then + If OnFirst = True Then + OnFirst = False + XorNum = N - i + 1 + Else + XorNum = XorNum Xor (N - i + 1) + End If + End If + Next + Dim Humming As String = ToBinary(XorNum, K) + Outputs = InputBox.Text + For i = 1 To K + Insert(Outputs, 2 ^ (i - 1) - 1, Mid(Humming, Humming.Length - i + 1, 1)) + Next + OutputBox.Text = Outputs + End Sub + + Private Sub Insert(ByRef s As String, ByVal a As Integer, ByVal ins As String) + If a = 0 Then + s += ins + Exit Sub + End If + Dim s1 As String = Mid(s, 1, s.Length - a) + Dim s2 As String = Mid(s, s.Length - a + 1) + s = s1 & ins & s2 + End Sub + + Private Function ToBinary(ByVal a As Integer, ByVal lens As Integer) + ToBinary = "" + While a > 0 + If a Mod 2 = 0 Then + ToBinary = "0" & ToBinary + Else + ToBinary = "1" & ToBinary + End If + a \= 2 + End While + While Len(ToBinary) < lens + ToBinary = "0" & ToBinary + End While + End Function +End Class diff --git a/95/95-2(VB.net)/95-2/My Project/Application.Designer.vb b/95/95-2(VB.net)/95-2/My Project/Application.Designer.vb new file mode 100644 index 0000000..676f227 --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_2.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-2(VB.net)/95-2/My Project/Application.myapp b/95/95-2(VB.net)/95-2/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-2(VB.net)/95-2/My Project/AssemblyInfo.vb b/95/95-2(VB.net)/95-2/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..da87386 --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-2(VB.net)/95-2/My Project/Resources.Designer.vb b/95/95-2(VB.net)/95-2/My Project/Resources.Designer.vb new file mode 100644 index 0000000..f1efd76 --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_2.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-2(VB.net)/95-2/My Project/Resources.resx b/95/95-2(VB.net)/95-2/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-2(VB.net)/95-2/My Project/Settings.Designer.vb b/95/95-2(VB.net)/95-2/My Project/Settings.Designer.vb new file mode 100644 index 0000000..6829b1c --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_2.My.MySettings + Get + Return Global._95_2.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-2(VB.net)/95-2/My Project/Settings.settings b/95/95-2(VB.net)/95-2/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-2(VB.net)/95-2/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-2(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" "b/95/95-2(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" new file mode 100644 index 0000000..e7b005c --- /dev/null +++ "b/95/95-2(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第2題", "95-2\95年工科技藝競賽第2題.vbproj", "{E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E3CA8DC2-AD2E-4A12-8C9F-536F061C97A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-3(VB.net)/2009-07-18_235432.png b/95/95-3(VB.net)/2009-07-18_235432.png new file mode 100644 index 0000000..6fda2a7 Binary files /dev/null and b/95/95-3(VB.net)/2009-07-18_235432.png differ diff --git "a/95/95-3(VB.net)/95-3/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" "b/95/95-3(VB.net)/95-3/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" new file mode 100644 index 0000000..d05a365 --- /dev/null +++ "b/95/95-3(VB.net)/95-3/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01} + WinExe + _95_3.My.MyApplication + _95_3 + 95-3 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-3(VB.net)/95-3/Form1.Designer.vb b/95/95-3(VB.net)/95-3/Form1.Designer.vb new file mode 100644 index 0000000..8dc9d63 --- /dev/null +++ b/95/95-3(VB.net)/95-3/Form1.Designer.vb @@ -0,0 +1,132 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.RadioCos = New System.Windows.Forms.RadioButton + Me.RadioSin = New System.Windows.Forms.RadioButton + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.Button3 = New System.Windows.Forms.Button + Me.OutputBox = New System.Windows.Forms.PictureBox + Me.GroupBox1.SuspendLayout() + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.RadioCos) + Me.GroupBox1.Controls.Add(Me.RadioSin) + Me.GroupBox1.Location = New System.Drawing.Point(12, 285) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(222, 49) + Me.GroupBox1.TabIndex = 0 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "函數圖形" + ' + 'RadioCos + ' + Me.RadioCos.AutoSize = True + Me.RadioCos.Location = New System.Drawing.Point(117, 19) + Me.RadioCos.Name = "RadioCos" + Me.RadioCos.Size = New System.Drawing.Size(91, 17) + Me.RadioCos.TabIndex = 1 + Me.RadioCos.TabStop = True + Me.RadioCos.Text = "Cos函數圖形" + Me.RadioCos.UseVisualStyleBackColor = True + ' + 'RadioSin + ' + Me.RadioSin.AutoSize = True + Me.RadioSin.Location = New System.Drawing.Point(21, 19) + Me.RadioSin.Name = "RadioSin" + Me.RadioSin.Size = New System.Drawing.Size(88, 17) + Me.RadioSin.TabIndex = 0 + Me.RadioSin.TabStop = True + Me.RadioSin.Text = "Sin函數圖形" + Me.RadioSin.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(277, 285) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "畫出" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(358, 285) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "清除" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Button3 + ' + Me.Button3.Location = New System.Drawing.Point(439, 285) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(75, 23) + Me.Button3.TabIndex = 3 + Me.Button3.Text = "結束" + Me.Button3.UseVisualStyleBackColor = True + ' + 'OutputBox + ' + Me.OutputBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.OutputBox.Location = New System.Drawing.Point(12, 12) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(502, 254) + Me.OutputBox.TabIndex = 4 + Me.OutputBox.TabStop = False + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(536, 347) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Button3) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.GroupBox1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第3題" + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents RadioCos As System.Windows.Forms.RadioButton + Friend WithEvents RadioSin As System.Windows.Forms.RadioButton + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents Button3 As System.Windows.Forms.Button + Friend WithEvents OutputBox As System.Windows.Forms.PictureBox + +End Class diff --git a/95/95-3(VB.net)/95-3/Form1.resx b/95/95-3(VB.net)/95-3/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-3(VB.net)/95-3/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-3(VB.net)/95-3/Form1.vb b/95/95-3(VB.net)/95-3/Form1.vb new file mode 100644 index 0000000..0649a33 --- /dev/null +++ b/95/95-3(VB.net)/95-3/Form1.vb @@ -0,0 +1,41 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim g As Graphics = OutputBox.CreateGraphics() + Dim pi As Single = 3.14 + Dim W As Single = OutputBox.Width + Dim H As Single = OutputBox.Height + Dim x, y, lx, ly As Single + g.DrawLine(Pens.Black, 0, H / 2, W, H / 2) + If RadioSin.Checked = True Then + lx = 0 + ly = H / 2.1 + 5 + For i = 0.01 To pi * 2 Step 0.01 + x = i * W / (pi * 2) + y = (-Math.Sin(i) + 1) * H / 2.1 + 5 + g.DrawLine(Pens.Black, lx, ly, x, y) + lx = x + ly = y + Next + Else + lx = 0 + ly = 5 + For i = 0.01 To pi * 2 Step 0.01 + x = i * W / (pi * 2) + y = (-Math.Cos(i) + 1) * H / 2.1 + 5 + g.DrawLine(Pens.Black, lx, ly, x, y) + lx = x + ly = y + Next + End If + + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + OutputBox.CreateGraphics().Clear(Color.White) + End Sub + + Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click + End + End Sub +End Class diff --git a/95/95-3(VB.net)/95-3/My Project/Application.Designer.vb b/95/95-3(VB.net)/95-3/My Project/Application.Designer.vb new file mode 100644 index 0000000..93e2a90 --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_3.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-3(VB.net)/95-3/My Project/Application.myapp b/95/95-3(VB.net)/95-3/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-3(VB.net)/95-3/My Project/AssemblyInfo.vb b/95/95-3(VB.net)/95-3/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..e8fba1b --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-3(VB.net)/95-3/My Project/Resources.Designer.vb b/95/95-3(VB.net)/95-3/My Project/Resources.Designer.vb new file mode 100644 index 0000000..078af32 --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_3.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-3(VB.net)/95-3/My Project/Resources.resx b/95/95-3(VB.net)/95-3/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-3(VB.net)/95-3/My Project/Settings.Designer.vb b/95/95-3(VB.net)/95-3/My Project/Settings.Designer.vb new file mode 100644 index 0000000..d0825f4 --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_3.My.MySettings + Get + Return Global._95_3.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-3(VB.net)/95-3/My Project/Settings.settings b/95/95-3(VB.net)/95-3/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-3(VB.net)/95-3/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-3(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" "b/95/95-3(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" new file mode 100644 index 0000000..fbe4ec3 --- /dev/null +++ "b/95/95-3(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第3題", "95-3\95年工科技藝競賽第3題.vbproj", "{66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66D7B3E5-5FDD-449F-9AE6-4BD013BB9C01}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-4(VB.net)/2009-07-18_235355.png b/95/95-4(VB.net)/2009-07-18_235355.png new file mode 100644 index 0000000..8f1cc71 Binary files /dev/null and b/95/95-4(VB.net)/2009-07-18_235355.png differ diff --git "a/95/95-4(VB.net)/95-4/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" "b/95/95-4(VB.net)/95-4/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" new file mode 100644 index 0000000..29189f6 --- /dev/null +++ "b/95/95-4(VB.net)/95-4/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C20BB853-2F80-49BC-81B7-73FE978DFB7F} + WinExe + _95_4.My.MyApplication + _95_4 + 95-4 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-4(VB.net)/95-4/Form1.Designer.vb b/95/95-4(VB.net)/95-4/Form1.Designer.vb new file mode 100644 index 0000000..fbd23a4 --- /dev/null +++ b/95/95-4(VB.net)/95-4/Form1.Designer.vb @@ -0,0 +1,162 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.DownBox = New System.Windows.Forms.TextBox + Me.UpBox = New System.Windows.Forms.TextBox + Me.TxtC = New System.Windows.Forms.TextBox + Me.TxtB = New System.Windows.Forms.TextBox + Me.TxtA = New System.Windows.Forms.TextBox + Me.Label5 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(202, 83) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 22 + Me.Button1.Text = "求解" + Me.Button1.UseVisualStyleBackColor = True + ' + 'DownBox + ' + Me.DownBox.Location = New System.Drawing.Point(187, 139) + Me.DownBox.Name = "DownBox" + Me.DownBox.Size = New System.Drawing.Size(100, 20) + Me.DownBox.TabIndex = 21 + ' + 'UpBox + ' + Me.UpBox.Location = New System.Drawing.Point(187, 122) + Me.UpBox.Name = "UpBox" + Me.UpBox.Size = New System.Drawing.Size(100, 20) + Me.UpBox.TabIndex = 20 + ' + 'TxtC + ' + Me.TxtC.Location = New System.Drawing.Point(59, 68) + Me.TxtC.Name = "TxtC" + Me.TxtC.Size = New System.Drawing.Size(100, 20) + Me.TxtC.TabIndex = 19 + ' + 'TxtB + ' + Me.TxtB.Location = New System.Drawing.Point(59, 38) + Me.TxtB.Name = "TxtB" + Me.TxtB.Size = New System.Drawing.Size(100, 20) + Me.TxtB.TabIndex = 18 + ' + 'TxtA + ' + Me.TxtA.Location = New System.Drawing.Point(59, 9) + Me.TxtA.Name = "TxtA" + Me.TxtA.Size = New System.Drawing.Size(100, 20) + Me.TxtA.TabIndex = 17 + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 71) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(41, 13) + Me.Label5.TabIndex = 16 + Me.Label5.Text = "Input C" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 41) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(41, 13) + Me.Label1.TabIndex = 15 + Me.Label1.Text = "Input B" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(66, 135) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(74, 13) + Me.Label4.TabIndex = 14 + Me.Label4.Text = "Function Here" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(165, 135) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(20, 13) + Me.Label3.TabIndex = 13 + Me.Label3.Text = "X=" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 9) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(41, 13) + Me.Label2.TabIndex = 12 + Me.Label2.Text = "Input A" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(325, 186) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.DownBox) + Me.Controls.Add(Me.UpBox) + Me.Controls.Add(Me.TxtC) + Me.Controls.Add(Me.TxtB) + Me.Controls.Add(Me.TxtA) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第4題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents DownBox As System.Windows.Forms.TextBox + Friend WithEvents UpBox As System.Windows.Forms.TextBox + Friend WithEvents TxtC As System.Windows.Forms.TextBox + Friend WithEvents TxtB As System.Windows.Forms.TextBox + Friend WithEvents TxtA As System.Windows.Forms.TextBox + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + +End Class diff --git a/95/95-4(VB.net)/95-4/Form1.resx b/95/95-4(VB.net)/95-4/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-4(VB.net)/95-4/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-4(VB.net)/95-4/Form1.vb b/95/95-4(VB.net)/95-4/Form1.vb new file mode 100644 index 0000000..bb854ae --- /dev/null +++ b/95/95-4(VB.net)/95-4/Form1.vb @@ -0,0 +1,30 @@ +Public Class Form1 + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim A, B, C As Double + A = Val(TxtA.Text) + B = Val(TxtB.Text) + C = Val(TxtC.Text) + If A = 0 And B = 0 And C <> 0 Then + UpBox.Text = "無解" + ElseIf A = 0 And B = 0 And C = 0 Then + UpBox.Text = "無限多解" + ElseIf A = 0 And B <> 0 Then + UpBox.Text = -C / B + DownBox.Text = "只有一解" + Else + Dim D As Double = B ^ 2 - 4 * A * C + If D = 0 Then + UpBox.Text = -B / (2 * A) + DownBox.Text = "同根" + ElseIf D > 0 Then + D = Math.Sqrt(D) + UpBox.Text = (-B + D) / (2 * A) + DownBox.Text = (-B - D) / (2 * A) + ElseIf D < 0 Then + D = Math.Sqrt(4 * A * C - B ^ 2) + UpBox.Text = Format(-B / (2 * A), "0.00") & "+" & Format(D / (2 * A), "0.00") & "i" + DownBox.Text = Format(-B / (2 * A), "0.00") & Format(-D / (2 * A), "0.00") & "i" + End If + End If + End Sub +End Class diff --git a/95/95-4(VB.net)/95-4/My Project/Application.Designer.vb b/95/95-4(VB.net)/95-4/My Project/Application.Designer.vb new file mode 100644 index 0000000..cb8bd3d --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_4.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-4(VB.net)/95-4/My Project/Application.myapp b/95/95-4(VB.net)/95-4/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-4(VB.net)/95-4/My Project/AssemblyInfo.vb b/95/95-4(VB.net)/95-4/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..581b38f --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-4(VB.net)/95-4/My Project/Resources.Designer.vb b/95/95-4(VB.net)/95-4/My Project/Resources.Designer.vb new file mode 100644 index 0000000..941d96a --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_4.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-4(VB.net)/95-4/My Project/Resources.resx b/95/95-4(VB.net)/95-4/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-4(VB.net)/95-4/My Project/Settings.Designer.vb b/95/95-4(VB.net)/95-4/My Project/Settings.Designer.vb new file mode 100644 index 0000000..1c3659f --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_4.My.MySettings + Get + Return Global._95_4.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-4(VB.net)/95-4/My Project/Settings.settings b/95/95-4(VB.net)/95-4/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-4(VB.net)/95-4/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-4(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" "b/95/95-4(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" new file mode 100644 index 0000000..07a5819 --- /dev/null +++ "b/95/95-4(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第4題", "95-4\95年工科技藝競賽第4題.vbproj", "{C20BB853-2F80-49BC-81B7-73FE978DFB7F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C20BB853-2F80-49BC-81B7-73FE978DFB7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C20BB853-2F80-49BC-81B7-73FE978DFB7F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C20BB853-2F80-49BC-81B7-73FE978DFB7F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C20BB853-2F80-49BC-81B7-73FE978DFB7F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-5(VB.net)/2009-07-18_234913.png b/95/95-5(VB.net)/2009-07-18_234913.png new file mode 100644 index 0000000..cd1b084 Binary files /dev/null and b/95/95-5(VB.net)/2009-07-18_234913.png differ diff --git "a/95/95-5(VB.net)/95-5/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" "b/95/95-5(VB.net)/95-5/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" new file mode 100644 index 0000000..1ddb16a --- /dev/null +++ "b/95/95-5(VB.net)/95-5/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {38B24C89-91A6-4495-A3DF-3D98FB7BF254} + WinExe + _95_5.My.MyApplication + _95_5 + 95-5 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-5(VB.net)/95-5/Form1.Designer.vb b/95/95-5(VB.net)/95-5/Form1.Designer.vb new file mode 100644 index 0000000..a19fda2 --- /dev/null +++ b/95/95-5(VB.net)/95-5/Form1.Designer.vb @@ -0,0 +1,72 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(78, 38) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(121, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "計算處理費" + Me.Button1.UseVisualStyleBackColor = True + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(12, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(268, 20) + Me.InputBox.TabIndex = 1 + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(12, 74) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(268, 20) + Me.OutputBox.TabIndex = 2 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(292, 106) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第5題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + +End Class diff --git a/95/95-5(VB.net)/95-5/Form1.resx b/95/95-5(VB.net)/95-5/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-5(VB.net)/95-5/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-5(VB.net)/95-5/Form1.vb b/95/95-5(VB.net)/95-5/Form1.vb new file mode 100644 index 0000000..a30ae7e --- /dev/null +++ b/95/95-5(VB.net)/95-5/Form1.vb @@ -0,0 +1,41 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim StrAry() As String = InputBox.Text.Split(" ") + Dim Data1 As Integer = Val(StrAry(0)) + Dim Data2 As Integer = Val(StrAry(1)) + Dim Answer As Integer = 0 + If WaterLevel(Data1) + ElectricLevel(Data2) = 2 Then + Answer = (Data1 + Data2) * 5 * 0.6 / 2 + ElseIf WaterLevel(Data1) + ElectricLevel(Data2) = 3 Then + Answer = (Data1 + Data2) * 5 * 0.8 / 2 + ElseIf WaterLevel(Data1) + ElectricLevel(Data2) = 6 Then + Answer = (Data1 + Data2) * 5 * 1.4 / 2 + ElseIf WaterLevel(Data1) + ElectricLevel(Data2) = 5 Then + Answer = (Data1 + Data2) * 5 * 1.2 / 2 + Else + Answer = (Data1 + Data2) * 5 / 2 + End If + OutputBox.Text = Str(Answer) + End Sub + Private Function WaterLevel(ByVal a As Integer) As Integer + Select Case a + Case Is < 50 + Return 1 + Case Is <= 100 + Return 2 + Case Else + Return 3 + End Select + End Function + Private Function ElectricLevel(ByVal a As Integer) As Integer + Select Case a + Case Is < 100 + Return 1 + Case Is <= 200 + Return 2 + Case Else + Return 3 + End Select + End Function +End Class diff --git a/95/95-5(VB.net)/95-5/My Project/Application.Designer.vb b/95/95-5(VB.net)/95-5/My Project/Application.Designer.vb new file mode 100644 index 0000000..23b7acf --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_5.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-5(VB.net)/95-5/My Project/Application.myapp b/95/95-5(VB.net)/95-5/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-5(VB.net)/95-5/My Project/AssemblyInfo.vb b/95/95-5(VB.net)/95-5/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..17762a3 --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-5(VB.net)/95-5/My Project/Resources.Designer.vb b/95/95-5(VB.net)/95-5/My Project/Resources.Designer.vb new file mode 100644 index 0000000..77085b4 --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_5.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-5(VB.net)/95-5/My Project/Resources.resx b/95/95-5(VB.net)/95-5/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-5(VB.net)/95-5/My Project/Settings.Designer.vb b/95/95-5(VB.net)/95-5/My Project/Settings.Designer.vb new file mode 100644 index 0000000..f83ef5f --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_5.My.MySettings + Get + Return Global._95_5.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-5(VB.net)/95-5/My Project/Settings.settings b/95/95-5(VB.net)/95-5/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-5(VB.net)/95-5/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-5(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" "b/95/95-5(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" new file mode 100644 index 0000000..e2af07c --- /dev/null +++ "b/95/95-5(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第5題", "95-5\95年工科技藝競賽第5題.vbproj", "{38B24C89-91A6-4495-A3DF-3D98FB7BF254}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {38B24C89-91A6-4495-A3DF-3D98FB7BF254}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38B24C89-91A6-4495-A3DF-3D98FB7BF254}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38B24C89-91A6-4495-A3DF-3D98FB7BF254}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38B24C89-91A6-4495-A3DF-3D98FB7BF254}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-6(VB.net)/2009-07-18_150427.png b/95/95-6(VB.net)/2009-07-18_150427.png new file mode 100644 index 0000000..0e0c7bc Binary files /dev/null and b/95/95-6(VB.net)/2009-07-18_150427.png differ diff --git "a/95/95-6(VB.net)/95-6/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" "b/95/95-6(VB.net)/95-6/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" new file mode 100644 index 0000000..dcd4ccb --- /dev/null +++ "b/95/95-6(VB.net)/95-6/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {555BEDC9-7BB7-4D11-A928-2513E8E194F8} + WinExe + _95_6.My.MyApplication + _95_6 + 95-6 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-6(VB.net)/95-6/Form1.Designer.vb b/95/95-6(VB.net)/95-6/Form1.Designer.vb new file mode 100644 index 0000000..e1945dd --- /dev/null +++ b/95/95-6(VB.net)/95-6/Form1.Designer.vb @@ -0,0 +1,74 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.InputBox = New System.Windows.Forms.TextBox + Me.Button1 = New System.Windows.Forms.Button + Me.OutputBox = New System.Windows.Forms.RichTextBox + Me.SuspendLayout() + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(12, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(606, 20) + Me.InputBox.TabIndex = 0 + Me.InputBox.Text = "Conventional approaches for encoding technique" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(12, 38) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 1 + Me.Button1.Text = "計算" + Me.Button1.UseVisualStyleBackColor = True + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(12, 72) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(605, 160) + Me.OutputBox.TabIndex = 2 + Me.OutputBox.Text = "" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(630, 247) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBox) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第6題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents OutputBox As System.Windows.Forms.RichTextBox + +End Class diff --git a/95/95-6(VB.net)/95-6/Form1.resx b/95/95-6(VB.net)/95-6/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-6(VB.net)/95-6/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-6(VB.net)/95-6/Form1.vb b/95/95-6(VB.net)/95-6/Form1.vb new file mode 100644 index 0000000..c54b8d5 --- /dev/null +++ b/95/95-6(VB.net)/95-6/Form1.vb @@ -0,0 +1,42 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim s As String = InputBox.Text + Dim StrAry(100) As String + Dim TotalAry(100) As Integer + Dim MaxChar As Integer = 0 + Dim isHave As Boolean + For i = 1 To InputBox.Text.Length + isHave = False + For j = 1 To MaxChar + If StrAry(j) = Mid(InputBox.Text, i, 1) Then + isHave = True + TotalAry(j) += 1 + Exit For + End If + Next + If isHave = False Then + MaxChar += 1 + StrAry(MaxChar) = Mid(InputBox.Text, i, 1) + TotalAry(MaxChar) = 1 + End If + Next + For i = 1 To MaxChar + For j = 1 To MaxChar - i + If TotalAry(j) < TotalAry(j + 1) Then + Dim tmp As Integer = TotalAry(j) + TotalAry(j) = TotalAry(j + 1) + TotalAry(j + 1) = tmp + Dim tmpp As String = StrAry(j) + StrAry(j) = StrAry(j + 1) + StrAry(j + 1) = tmpp + End If + Next + Next + OutputBox.Text = "" + For i = 1 To MaxChar + OutputBox.Text += """" & StrAry(i) & """" & "=" & Str(TotalAry(i)) & "; " + Next + + End Sub +End Class diff --git a/95/95-6(VB.net)/95-6/My Project/Application.Designer.vb b/95/95-6(VB.net)/95-6/My Project/Application.Designer.vb new file mode 100644 index 0000000..6d79533 --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_6.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-6(VB.net)/95-6/My Project/Application.myapp b/95/95-6(VB.net)/95-6/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-6(VB.net)/95-6/My Project/AssemblyInfo.vb b/95/95-6(VB.net)/95-6/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..d00afad --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-6(VB.net)/95-6/My Project/Resources.Designer.vb b/95/95-6(VB.net)/95-6/My Project/Resources.Designer.vb new file mode 100644 index 0000000..addbc57 --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_6.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-6(VB.net)/95-6/My Project/Resources.resx b/95/95-6(VB.net)/95-6/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-6(VB.net)/95-6/My Project/Settings.Designer.vb b/95/95-6(VB.net)/95-6/My Project/Settings.Designer.vb new file mode 100644 index 0000000..059ea2b --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_6.My.MySettings + Get + Return Global._95_6.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-6(VB.net)/95-6/My Project/Settings.settings b/95/95-6(VB.net)/95-6/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-6(VB.net)/95-6/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-6(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" "b/95/95-6(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" new file mode 100644 index 0000000..e0619d2 --- /dev/null +++ "b/95/95-6(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第6題", "95-6\95年工科技藝競賽第6題.vbproj", "{555BEDC9-7BB7-4D11-A928-2513E8E194F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {555BEDC9-7BB7-4D11-A928-2513E8E194F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {555BEDC9-7BB7-4D11-A928-2513E8E194F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {555BEDC9-7BB7-4D11-A928-2513E8E194F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {555BEDC9-7BB7-4D11-A928-2513E8E194F8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/95/95-7(VB.net)/2009-07-18_150402.png b/95/95-7(VB.net)/2009-07-18_150402.png new file mode 100644 index 0000000..825982a Binary files /dev/null and b/95/95-7(VB.net)/2009-07-18_150402.png differ diff --git "a/95/95-7(VB.net)/95-7/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" "b/95/95-7(VB.net)/95-7/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" new file mode 100644 index 0000000..539d050 --- /dev/null +++ "b/95/95-7(VB.net)/95-7/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {231C17BF-C6C6-4D4A-BE31-3C1AB699F369} + WinExe + _95_7.My.MyApplication + _95_7 + 95-7 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 95-7.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 95-7.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/95/95-7(VB.net)/95-7/Form1.Designer.vb b/95/95-7(VB.net)/95-7/Form1.Designer.vb new file mode 100644 index 0000000..92e04c9 --- /dev/null +++ b/95/95-7(VB.net)/95-7/Form1.Designer.vb @@ -0,0 +1,165 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.InputR = New System.Windows.Forms.TextBox + Me.InputC = New System.Windows.Forms.TextBox + Me.Inputf = New System.Windows.Forms.TextBox + Me.Button1 = New System.Windows.Forms.Button + Me.Label4 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.OutputZ = New System.Windows.Forms.TextBox + Me.OutputPhase = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(117, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "電阻值R,單位歐姆=" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 36) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(116, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "電容值C,單位法拉=" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 61) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(112, 13) + Me.Label3.TabIndex = 2 + Me.Label3.Text = "頻率值f,單位赫芝=" + ' + 'InputR + ' + Me.InputR.Location = New System.Drawing.Point(135, 6) + Me.InputR.Name = "InputR" + Me.InputR.Size = New System.Drawing.Size(100, 20) + Me.InputR.TabIndex = 3 + Me.InputR.Text = "1600" + ' + 'InputC + ' + Me.InputC.Location = New System.Drawing.Point(135, 32) + Me.InputC.Name = "InputC" + Me.InputC.Size = New System.Drawing.Size(100, 20) + Me.InputC.TabIndex = 4 + Me.InputC.Text = "0.000001" + ' + 'Inputf + ' + Me.Inputf.Location = New System.Drawing.Point(135, 58) + Me.Inputf.Name = "Inputf" + Me.Inputf.Size = New System.Drawing.Size(100, 20) + Me.Inputf.TabIndex = 5 + Me.Inputf.Text = "1000" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(107, 97) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 6 + Me.Button1.Text = "計算" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(17, 149) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(80, 13) + Me.Label4.TabIndex = 7 + Me.Label4.Text = "濾波器大小Z=" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(12, 172) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(85, 13) + Me.Label5.TabIndex = 8 + Me.Label5.Text = "濾波器的相角=" + ' + 'OutputZ + ' + Me.OutputZ.Location = New System.Drawing.Point(98, 146) + Me.OutputZ.Name = "OutputZ" + Me.OutputZ.Size = New System.Drawing.Size(100, 20) + Me.OutputZ.TabIndex = 9 + ' + 'OutputPhase + ' + Me.OutputPhase.Location = New System.Drawing.Point(98, 169) + Me.OutputPhase.Name = "OutputPhase" + Me.OutputPhase.Size = New System.Drawing.Size(100, 20) + Me.OutputPhase.TabIndex = 10 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(248, 209) + Me.Controls.Add(Me.OutputPhase) + Me.Controls.Add(Me.OutputZ) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.Inputf) + Me.Controls.Add(Me.InputC) + Me.Controls.Add(Me.InputR) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "95年工科技藝競賽第7題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents InputR As System.Windows.Forms.TextBox + Friend WithEvents InputC As System.Windows.Forms.TextBox + Friend WithEvents Inputf As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents OutputZ As System.Windows.Forms.TextBox + Friend WithEvents OutputPhase As System.Windows.Forms.TextBox + +End Class diff --git a/95/95-7(VB.net)/95-7/Form1.resx b/95/95-7(VB.net)/95-7/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/95/95-7(VB.net)/95-7/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-7(VB.net)/95-7/Form1.vb b/95/95-7(VB.net)/95-7/Form1.vb new file mode 100644 index 0000000..ecdeb7d --- /dev/null +++ b/95/95-7(VB.net)/95-7/Form1.vb @@ -0,0 +1,19 @@ +Public Class Form1 + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim R, C, f, Z, Phase, RealNumber, imaginary, Xc As Double + R = Val(InputR.Text) + C = Val(InputC.Text) + f = Val(Inputf.Text) + Dim pi As Double = 4 * Math.Atan(1) + Xc = 1 / (2 * pi * f * C) + RealNumber = 1 / (1 - (2 * pi * f * R * C) ^ 2) + imaginary = (-2 * pi * f * R * C) / (1 - (2 * pi * f * R * C) ^ 2) + 'Phase = Math.Atan(-R / Xc) * 180 / pi + 'Z = Math.Abs(Xc / (Xc ^ 2 + R ^ 2) ^ 0.5) + Phase = Math.Atan(imaginary / RealNumber) * 180 / pi + Z = Math.Abs(RealNumber / (imaginary ^ 2 + RealNumber ^ 2) ^ 0.5) + Z = 20 * Math.Log10(Z) + OutputZ.Text = Format(Z, "0.000") & "dB" + OutputPhase.Text = Format(Phase, "0.000") + End Sub +End Class diff --git a/95/95-7(VB.net)/95-7/My Project/Application.Designer.vb b/95/95-7(VB.net)/95-7/My Project/Application.Designer.vb new file mode 100644 index 0000000..65d3977 --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._95_7.Form1 + End Sub + End Class +End Namespace diff --git a/95/95-7(VB.net)/95-7/My Project/Application.myapp b/95/95-7(VB.net)/95-7/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/95/95-7(VB.net)/95-7/My Project/AssemblyInfo.vb b/95/95-7(VB.net)/95-7/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..5728ee2 --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/95/95-7(VB.net)/95-7/My Project/Resources.Designer.vb b/95/95-7(VB.net)/95-7/My Project/Resources.Designer.vb new file mode 100644 index 0000000..2446766 --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_95_7.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/95/95-7(VB.net)/95-7/My Project/Resources.resx b/95/95-7(VB.net)/95-7/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/95/95-7(VB.net)/95-7/My Project/Settings.Designer.vb b/95/95-7(VB.net)/95-7/My Project/Settings.Designer.vb new file mode 100644 index 0000000..22bd92a --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._95_7.My.MySettings + Get + Return Global._95_7.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/95/95-7(VB.net)/95-7/My Project/Settings.settings b/95/95-7(VB.net)/95-7/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/95/95-7(VB.net)/95-7/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/95/95-7(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" "b/95/95-7(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" new file mode 100644 index 0000000..7a95d87 --- /dev/null +++ "b/95/95-7(VB.net)/95\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "95年工科技藝競賽第7題", "95-7\95年工科技藝競賽第7題.vbproj", "{231C17BF-C6C6-4D4A-BE31-3C1AB699F369}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {231C17BF-C6C6-4D4A-BE31-3C1AB699F369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {231C17BF-C6C6-4D4A-BE31-3C1AB699F369}.Debug|Any CPU.Build.0 = Debug|Any CPU + {231C17BF-C6C6-4D4A-BE31-3C1AB699F369}.Release|Any CPU.ActiveCfg = Release|Any CPU + {231C17BF-C6C6-4D4A-BE31-3C1AB699F369}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-1(VB.net)/2009-07-18_144948.png b/96/96-1(VB.net)/2009-07-18_144948.png new file mode 100644 index 0000000..1ce8c44 Binary files /dev/null and b/96/96-1(VB.net)/2009-07-18_144948.png differ diff --git "a/96/96-1(VB.net)/96-1/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" "b/96/96-1(VB.net)/96-1/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" new file mode 100644 index 0000000..72cbbf2 --- /dev/null +++ "b/96/96-1(VB.net)/96-1/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3A95EFF0-71E2-4266-ABED-E4CE0E14A16C} + WinExe + _96_1.My.MyApplication + _96_1 + 96-1 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-1(VB.net)/96-1/Form1.Designer.vb b/96/96-1(VB.net)/96-1/Form1.Designer.vb new file mode 100644 index 0000000..5c439ee --- /dev/null +++ b/96/96-1(VB.net)/96-1/Form1.Designer.vb @@ -0,0 +1,177 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.OutputBox = New System.Windows.Forms.PictureBox + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.Button3 = New System.Windows.Forms.Button + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Output1 = New System.Windows.Forms.Label + Me.Output2 = New System.Windows.Forms.Label + Me.Output3 = New System.Windows.Forms.Label + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(326, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(147, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "X-Routing for any three points" + ' + 'OutputBox + ' + Me.OutputBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.OutputBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.OutputBox.Location = New System.Drawing.Point(34, 37) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(757, 467) + Me.OutputBox.TabIndex = 1 + Me.OutputBox.TabStop = False + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(34, 563) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 2 + Me.Button1.Text = "Generate(&G)" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(115, 563) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 3 + Me.Button2.Text = "X-Route(&X)" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Button3 + ' + Me.Button3.Location = New System.Drawing.Point(196, 563) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(75, 23) + Me.Button3.TabIndex = 4 + Me.Button3.Text = "Exit" + Me.Button3.UseVisualStyleBackColor = True + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(288, 521) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(81, 13) + Me.Label2.TabIndex = 5 + Me.Label2.Text = "Non-45 Length:" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(296, 545) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(73, 13) + Me.Label3.TabIndex = 6 + Me.Label3.Text = "on-45 Length:" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(326, 568) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(43, 13) + Me.Label4.TabIndex = 7 + Me.Label4.Text = "Saving:" + ' + 'Output1 + ' + Me.Output1.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.Output1.Location = New System.Drawing.Point(375, 521) + Me.Output1.Name = "Output1" + Me.Output1.Size = New System.Drawing.Size(74, 18) + Me.Output1.TabIndex = 8 + Me.Output1.Text = " " + ' + 'Output2 + ' + Me.Output2.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.Output2.Location = New System.Drawing.Point(375, 545) + Me.Output2.Name = "Output2" + Me.Output2.Size = New System.Drawing.Size(74, 18) + Me.Output2.TabIndex = 9 + Me.Output2.Text = " " + ' + 'Output3 + ' + Me.Output3.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.Output3.Location = New System.Drawing.Point(375, 568) + Me.Output3.Name = "Output3" + Me.Output3.Size = New System.Drawing.Size(74, 18) + Me.Output3.TabIndex = 10 + Me.Output3.Text = " " + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange + Me.ClientSize = New System.Drawing.Size(803, 598) + Me.Controls.Add(Me.Output3) + Me.Controls.Add(Me.Output2) + Me.Controls.Add(Me.Output1) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Button3) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Label1) + Me.KeyPreview = True + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "96年工科技藝競賽第1題" + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents OutputBox As System.Windows.Forms.PictureBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents Button3 As System.Windows.Forms.Button + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Output1 As System.Windows.Forms.Label + Friend WithEvents Output2 As System.Windows.Forms.Label + Friend WithEvents Output3 As System.Windows.Forms.Label + +End Class diff --git a/96/96-1(VB.net)/96-1/Form1.resx b/96/96-1(VB.net)/96-1/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/96/96-1(VB.net)/96-1/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-1(VB.net)/96-1/Form1.vb b/96/96-1(VB.net)/96-1/Form1.vb new file mode 100644 index 0000000..98d6653 --- /dev/null +++ b/96/96-1(VB.net)/96-1/Form1.vb @@ -0,0 +1,155 @@ +Public Class Form1 + Dim points(3) As Point + Dim maxY, minY, midY, maxX, minX, midX, Sum, Xsum As Single + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Do + RandomPoints() + Sum = maxX - minX + Sum += maxY - minY + Button2.PerformClick() + Loop While Sum = Xsum '當不能省線長時找別的點看看 + Output1.Text = Str(Sum) + Output2.Text = "" + Output3.Text = "" + Dim g As Graphics = OutputBox.CreateGraphics() + g.Clear(Color.White) + DrawPoints() + g.DrawLine(Pens.Black, maxX, midY, minX, midY) + g.DrawLine(Pens.Black, points(1).X, minY, points(1).X, midY) + g.DrawLine(Pens.Black, points(3).X, maxY, points(3).X, midY) + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + Dim H1 As Integer = midY - minY '第一段高 + Dim H2 As Integer = maxY - midY '第二段高 + Dim W1 As Integer = Math.Abs(points(1).X - points(2).X) '第一段長 + Dim W2 As Integer = Math.Abs(points(2).X - points(3).X) '第二段長 + Dim X1st, X2nd As Integer 'X1st儲放第一個折點的X值,X2nd儲放第二個折點的X值 + Dim Su1, Su2, Su3 As Integer '各段計算後的總合 + Su1 = 9999 + Su2 = 9999 + Su3 = 9999 + '第一段可繞線的長度計算 + If W1 > H1 Then + If (points(1).X > points(2).X) Then + X1st = points(1).X - H1 + Else + X1st = points(1).X + H1 + End If + Su1 = ((points(1).X - X1st) ^ 2 + (points(1).Y - midY) ^ 2) ^ 0.5 + Su1 += maxY - midY + Su1 += Math.Abs(X1st - points(2).X) + Math.Abs(points(3).X - points(2).X) + If X1st >= points(2).X And points(3).X >= points(2).X Or X1st <= points(2).X And points(3).X <= points(2).X Then + Su1 -= Math.Min(Math.Abs(X1st - points(2).X), Math.Abs(points(3).X - points(2).X)) + End If + End If + '第二段可繞線的長度計算 + If W2 > H2 Then + If (points(3).X > points(2).X) Then + X2nd = points(3).X - H2 + Else + X2nd = points(3).X + H2 + End If + Su2 = ((points(3).X - X2nd) ^ 2 + (points(3).Y - midY) ^ 2) ^ 0.5 + Su2 += midY - minY + Su2 += Math.Abs(points(1).X - points(2).X) + Math.Abs(X2nd - points(2).X) + If X2nd >= points(2).X And points(1).X >= points(2).X Or points(1).X <= points(2).X And X2nd <= points(2).X Then + Su2 -= Math.Min(Math.Abs(X2nd - points(2).X), Math.Abs(points(1).X - points(2).X)) + End If + End If + '一二段都可繞線的長度計算 + If W1 > H1 And W2 > H2 Then + Su3 = ((points(1).X - X1st) ^ 2 + (points(1).Y - midY) ^ 2) ^ 0.5 + Su3 += ((points(3).X - X2nd) ^ 2 + (points(3).Y - midY) ^ 2) ^ 0.5 + Su3 += Math.Abs(X1st - points(2).X) + Math.Abs(X2nd - points(2).X) + If X1st >= points(2).X And X2nd >= points(2).X Or X1st <= points(2).X And X2nd <= points(2).X Then + Su3 -= Math.Min(Math.Abs(X1st - points(2).X), Math.Abs(X2nd - points(2).X)) + End If + End If + '計算出結果 + Xsum = Math.Min(Sum, fMin(Su1, Su2, Su3)) + Output2.Text = Str(Xsum) + Output3.Text = Format((Sum - Xsum) / Sum * 100, "0.00") + "%" + '畫出最短的線 + Dim g As Graphics = OutputBox.CreateGraphics() + g.Clear(Color.White) + DrawPoints() + Select Case Xsum + Case Su1 + g.DrawLine(Pens.Black, points(1).X, points(1).Y, X1st, midY) + g.DrawLine(Pens.Black, points(3).X, maxY, points(3).X, midY) + g.DrawLine(Pens.Black, X1st, midY, points(2).X, midY) + g.DrawLine(Pens.Black, points(3).X, midY, points(2).X, midY) + Case Su2 + g.DrawLine(Pens.Black, points(3).X, points(3).Y, X2nd, midY) + g.DrawLine(Pens.Black, points(1).X, minY, points(1).X, midY) + g.DrawLine(Pens.Black, points(1).X, midY, points(2).X, midY) + g.DrawLine(Pens.Black, X2nd, midY, points(2).X, midY) + Case Su3 + g.DrawLine(Pens.Black, points(1).X, points(1).Y, X1st, midY) + g.DrawLine(Pens.Black, points(3).X, points(3).Y, X2nd, midY) + g.DrawLine(Pens.Black, X1st, midY, points(2).X, midY) + g.DrawLine(Pens.Black, X2nd, midY, points(2).X, midY) + Case Sum + g.DrawLine(Pens.Black, maxX, midY, minX, midY) + g.DrawLine(Pens.Black, points(1).X, minY, points(1).X, midY) + g.DrawLine(Pens.Black, points(3).X, maxY, points(3).X, midY) + End Select + End Sub + + Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click + End + End Sub + + Private Function fMax(ByVal a As Single, ByVal b As Single, ByVal c As Single) As Single + Return Math.Max(a, Math.Max(b, c)) + End Function + Private Function fMin(ByVal a As Single, ByVal b As Single, ByVal c As Single) As Single + Return Math.Min(a, Math.Min(b, c)) + End Function + + Private Sub RandomPoints() + Randomize(Now.Millisecond) + Do + For i = 1 To 3 + points(i).X = Rnd() * (OutputBox.Width - 20) + 10 + points(i).Y = Rnd() * (OutputBox.Height - 20) + 10 + Next + If points(1).Y > points(2).Y Then + swap(points(1), points(2)) + End If + If points(2).Y > points(3).Y Then + swap(points(2), points(3)) + End If + If points(1).Y > points(2).Y Then + swap(points(1), points(2)) + End If + Loop While (Math.Abs(points(1).Y - points(2).Y) < 10) Or (Math.Abs(points(2).Y - points(3).Y)) < 10 _ + Or (Math.Abs(points(1).X - points(2).X) < 10) Or (Math.Abs(points(2).X - points(3).X)) < 10 + maxY = fMax(points(1).Y, points(2).Y, points(3).Y) + minY = fMin(points(1).Y, points(2).Y, points(3).Y) + For i = 1 To 3 + If points(i).Y <> maxY And points(i).Y <> minY Then + midY = points(i).Y + End If + Next + maxX = fMax(points(1).X, points(2).X, points(3).X) + minX = fMin(points(1).X, points(2).X, points(3).X) + For i = 1 To 3 + If points(i).X <> maxX And points(i).X <> minX Then + midX = points(i).X + End If + Next + End Sub + Private Sub swap(Of T)(ByRef a As T, ByRef b As T) + Dim tmp As T = a + a = b + b = tmp + End Sub + Private Sub DrawPoints() + Dim g As Graphics = OutputBox.CreateGraphics() + For i = 1 To 3 + g.FillEllipse(Brushes.Black, points(i).X - 4, points(i).Y - 4, 8, 8) + Next + End Sub +End Class diff --git a/96/96-1(VB.net)/96-1/My Project/Application.Designer.vb b/96/96-1(VB.net)/96-1/My Project/Application.Designer.vb new file mode 100644 index 0000000..2078de2 --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_1.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-1(VB.net)/96-1/My Project/Application.myapp b/96/96-1(VB.net)/96-1/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-1(VB.net)/96-1/My Project/AssemblyInfo.vb b/96/96-1(VB.net)/96-1/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..b1910aa --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-1(VB.net)/96-1/My Project/Resources.Designer.vb b/96/96-1(VB.net)/96-1/My Project/Resources.Designer.vb new file mode 100644 index 0000000..84be6d8 --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_1.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-1(VB.net)/96-1/My Project/Resources.resx b/96/96-1(VB.net)/96-1/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-1(VB.net)/96-1/My Project/Settings.Designer.vb b/96/96-1(VB.net)/96-1/My Project/Settings.Designer.vb new file mode 100644 index 0000000..52c2598 --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_1.My.MySettings + Get + Return Global._96_1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-1(VB.net)/96-1/My Project/Settings.settings b/96/96-1(VB.net)/96-1/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-1(VB.net)/96-1/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-1(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" "b/96/96-1(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" new file mode 100644 index 0000000..02ec752 --- /dev/null +++ "b/96/96-1(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第1題", "96-1\96年工科技藝競賽第1題.vbproj", "{3A95EFF0-71E2-4266-ABED-E4CE0E14A16C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3A95EFF0-71E2-4266-ABED-E4CE0E14A16C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A95EFF0-71E2-4266-ABED-E4CE0E14A16C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A95EFF0-71E2-4266-ABED-E4CE0E14A16C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A95EFF0-71E2-4266-ABED-E4CE0E14A16C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-2(VB.net)/2009-07-18_145113.png b/96/96-2(VB.net)/2009-07-18_145113.png new file mode 100644 index 0000000..d87a10c Binary files /dev/null and b/96/96-2(VB.net)/2009-07-18_145113.png differ diff --git a/96/96-2(VB.net)/2009-07-18_145133.png b/96/96-2(VB.net)/2009-07-18_145133.png new file mode 100644 index 0000000..d8b3c08 Binary files /dev/null and b/96/96-2(VB.net)/2009-07-18_145133.png differ diff --git "a/96/96-2(VB.net)/96-2/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" "b/96/96-2(VB.net)/96-2/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" new file mode 100644 index 0000000..424e9ea --- /dev/null +++ "b/96/96-2(VB.net)/96-2/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {B1F0B242-56F5-4604-8D3D-CE5C47252EB9} + WinExe + _96_2.My.MyApplication + _96_2 + 96-2 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-2(VB.net)/96-2/Form1.Designer.vb b/96/96-2(VB.net)/96-2/Form1.Designer.vb new file mode 100644 index 0000000..2f1d8dd --- /dev/null +++ b/96/96-2(VB.net)/96-2/Form1.Designer.vb @@ -0,0 +1,118 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.MessageLabel = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label1 = New System.Windows.Forms.Label + Me.BtnRomove = New System.Windows.Forms.Button + Me.Button3 = New System.Windows.Forms.Button + Me.BtnAdd = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'MessageLabel + ' + Me.MessageLabel.BackColor = System.Drawing.Color.White + Me.MessageLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle + Me.MessageLabel.Font = New System.Drawing.Font("新細明體", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.MessageLabel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.MessageLabel.Location = New System.Drawing.Point(313, 9) + Me.MessageLabel.Name = "MessageLabel" + Me.MessageLabel.Size = New System.Drawing.Size(189, 35) + Me.MessageLabel.TabIndex = 12 + Me.MessageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Font = New System.Drawing.Font("新細明體", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.Label2.Location = New System.Drawing.Point(199, 9) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(108, 27) + Me.Label2.TabIndex = 10 + Me.Label2.Text = "Message:" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("新細明體", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(167, 27) + Me.Label1.TabIndex = 11 + Me.Label1.Text = "Circular Queue" + ' + 'BtnRomove + ' + Me.BtnRomove.Location = New System.Drawing.Point(635, 15) + Me.BtnRomove.Name = "BtnRomove" + Me.BtnRomove.Size = New System.Drawing.Size(75, 23) + Me.BtnRomove.TabIndex = 9 + Me.BtnRomove.Text = "Romove(&R)" + Me.BtnRomove.UseVisualStyleBackColor = True + ' + 'Button3 + ' + Me.Button3.Location = New System.Drawing.Point(749, 15) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(75, 23) + Me.Button3.TabIndex = 8 + Me.Button3.Text = "Exit" + Me.Button3.UseVisualStyleBackColor = True + ' + 'BtnAdd + ' + Me.BtnAdd.Location = New System.Drawing.Point(527, 15) + Me.BtnAdd.Name = "BtnAdd" + Me.BtnAdd.Size = New System.Drawing.Size(71, 23) + Me.BtnAdd.TabIndex = 7 + Me.BtnAdd.Text = "Add(&A)" + Me.BtnAdd.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(863, 575) + Me.Controls.Add(Me.MessageLabel) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.BtnRomove) + Me.Controls.Add(Me.Button3) + Me.Controls.Add(Me.BtnAdd) + Me.KeyPreview = True + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "96年工科技藝競賽第4題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents MessageLabel As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents BtnRomove As System.Windows.Forms.Button + Friend WithEvents Button3 As System.Windows.Forms.Button + Friend WithEvents BtnAdd As System.Windows.Forms.Button + +End Class diff --git a/96/96-2(VB.net)/96-2/Form1.resx b/96/96-2(VB.net)/96-2/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/96/96-2(VB.net)/96-2/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-2(VB.net)/96-2/Form1.vb b/96/96-2(VB.net)/96-2/Form1.vb new file mode 100644 index 0000000..7201b1e --- /dev/null +++ b/96/96-2(VB.net)/96-2/Form1.vb @@ -0,0 +1,136 @@ +Public Class Form1 + Dim LabelQueue() As Label + Dim Rear, Front, Ran, QueueData(1024) As Integer + Dim QueueMAX As Integer + Const SQURE_WIDTH As Integer = 30 + Const INITIALIZE_NUM As Integer = 6 + Const NULL As Integer = 0 + + Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated + ReDim LabelQueue(384) + For i As Integer = 1 To INITIALIZE_NUM + LabelQueue(i) = New Label + With LabelQueue(i) + .Left = SQURE_WIDTH * i + .Top = 60 + .Width = SQURE_WIDTH + .Height = SQURE_WIDTH + .BackColor = Color.White + .BorderStyle = BorderStyle.FixedSingle + .Visible = True + Me.Controls.Add(LabelQueue(i)) + End With + Next + QueueMAX = INITIALIZE_NUM + QueueData(5) = 35 + QueueData(6) = 128 + Front = 5 + Rear = 6 + ShowNow() + End Sub + + Private Sub BtnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAdd.Click + If CanAdd(QueueData, QueueMAX) = True Then + If Rear = Front And QueueData(Rear) = 0 Then + Ran = 1 + Int(Rnd() * 999) + MessageLabel.Text = "Add " & Str(Ran) + QueueData(Rear) = Ran + Else + Rear += 1 + If Rear > QueueMAX Then Rear = 1 + Ran = 1 + Int(Rnd() * 999) + MessageLabel.Text = "Add " & Str(Ran) + QueueData(Rear) = Ran + End If + Else + If QueueMAX >= 384 Then + MessageLabel.Text = "Fulled." + Exit Sub + End If + '增加新的label + For i = QueueMAX + 1 To QueueMAX * 2 + LabelQueue(i) = New Label + With LabelQueue(i) + .Left = SQURE_WIDTH * ((i - 1) Mod 24 + 1) + .Top = 60 + ((i - 1) \ 24) * SQURE_WIDTH + .Width = SQURE_WIDTH + .Height = SQURE_WIDTH + .BackColor = Color.White + .BorderStyle = BorderStyle.FixedSingle + .Visible = True + Me.Controls.Add(LabelQueue(i)) + End With + Next + Dim AddNumber As Integer = QueueMAX + QueueMAX *= 2 + If Rear = AddNumber - 1 Or Front = 2 Then + + ElseIf Rear >= Front Then + For i = AddNumber To Rear Step -1 + QueueData(i + AddNumber) = QueueData(i) + QueueData(i) = 0 + Next + Rear = Rear + AddNumber + ElseIf Rear < Front Then + For i = QueueMAX - AddNumber To Front Step -1 + QueueData(i + AddNumber) = QueueData(i) + QueueData(i) = NULL + Next + Front = Front + AddNumber + End If + Rear += 1 + If Rear > QueueMAX Then Rear = 1 + Ran = 1 + Int(Rnd() * 999) + MessageLabel.Text = "Add " & Str(Ran) + QueueData(Rear) = Ran + End If + ShowNow() + End Sub + + Private Sub BtnRomove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRomove.Click + If CanRomove(QueueData, QueueMAX) = True Then + MessageLabel.Text = "Romove " & Str(QueueData(Front)) + QueueData(Front) = 0 + If Front <> Rear Then + Front += 1 + If Front > QueueMAX Then Front = 1 + End If + Else + MessageLabel.Text = "Empty." + End If + ShowNow() + End Sub + + Sub ShowNow() + Dim x As Integer + For i As Int16 = 1 To QueueMAX + LabelQueue(i).TextAlign = ContentAlignment.MiddleCenter + If QueueData(i) <> 0 Then + LabelQueue(i).Text = QueueData(i) + x = x + 1 + Else + LabelQueue(i).Text = "" + End If + Next + End Sub + + Function CanAdd(ByVal LabelQueue() As Integer, ByVal big As Integer) As Boolean + Dim x As Integer + CanAdd = True + For i As Integer = 1 To big + If LabelQueue(i) = 0 Then x = x + 1 + Next + If x < 2 Then CanAdd = False + End Function + + Function CanRomove(ByVal LabelQueue() As Integer, ByVal big As Integer) As Boolean + CanRomove = False + For i As Integer = 1 To big + If LabelQueue(i) <> 0 Then CanRomove = True + Next + End Function + + Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click + End + End Sub +End Class diff --git a/96/96-2(VB.net)/96-2/My Project/Application.Designer.vb b/96/96-2(VB.net)/96-2/My Project/Application.Designer.vb new file mode 100644 index 0000000..d604658 --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_2.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-2(VB.net)/96-2/My Project/Application.myapp b/96/96-2(VB.net)/96-2/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-2(VB.net)/96-2/My Project/AssemblyInfo.vb b/96/96-2(VB.net)/96-2/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..e60bffa --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-2(VB.net)/96-2/My Project/Resources.Designer.vb b/96/96-2(VB.net)/96-2/My Project/Resources.Designer.vb new file mode 100644 index 0000000..999dc02 --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_2.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-2(VB.net)/96-2/My Project/Resources.resx b/96/96-2(VB.net)/96-2/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-2(VB.net)/96-2/My Project/Settings.Designer.vb b/96/96-2(VB.net)/96-2/My Project/Settings.Designer.vb new file mode 100644 index 0000000..9516918 --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_2.My.MySettings + Get + Return Global._96_2.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-2(VB.net)/96-2/My Project/Settings.settings b/96/96-2(VB.net)/96-2/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-2(VB.net)/96-2/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-2(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" "b/96/96-2(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" new file mode 100644 index 0000000..f1c6486 --- /dev/null +++ "b/96/96-2(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第4題", "96-2\96年工科技藝競賽第4題.vbproj", "{B1F0B242-56F5-4604-8D3D-CE5C47252EB9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B1F0B242-56F5-4604-8D3D-CE5C47252EB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B1F0B242-56F5-4604-8D3D-CE5C47252EB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B1F0B242-56F5-4604-8D3D-CE5C47252EB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B1F0B242-56F5-4604-8D3D-CE5C47252EB9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-3(VB.net)/2009-07-18_145206.png b/96/96-3(VB.net)/2009-07-18_145206.png new file mode 100644 index 0000000..ff5db9b Binary files /dev/null and b/96/96-3(VB.net)/2009-07-18_145206.png differ diff --git "a/96/96-3(VB.net)/96-3/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" "b/96/96-3(VB.net)/96-3/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" new file mode 100644 index 0000000..dd2e892 --- /dev/null +++ "b/96/96-3(VB.net)/96-3/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {C6291A88-5BA6-42EE-BB34-BEFE84077DCD} + WinExe + _96_3.My.MyApplication + _96_3 + 96-3 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-3(VB.net)/96-3/Form1.Designer.vb b/96/96-3(VB.net)/96-3/Form1.Designer.vb new file mode 100644 index 0000000..6ef0c7f --- /dev/null +++ b/96/96-3(VB.net)/96-3/Form1.Designer.vb @@ -0,0 +1,190 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button2 = New System.Windows.Forms.Button + Me.Button1 = New System.Windows.Forms.Button + Me.Label3 = New System.Windows.Forms.Label + Me.TextI = New System.Windows.Forms.TextBox + Me.TextB = New System.Windows.Forms.TextBox + Me.Label2 = New System.Windows.Forms.Label + Me.TextS = New System.Windows.Forms.TextBox + Me.TextG = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.TextH = New System.Windows.Forms.TextBox + Me.TextR = New System.Windows.Forms.TextBox + Me.Label6 = New System.Windows.Forms.Label + Me.Label5 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(194, 113) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(112, 29) + Me.Button2.TabIndex = 19 + Me.Button2.Text = "RGB + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-3(VB.net)/96-3/Form1.vb b/96/96-3(VB.net)/96-3/Form1.vb new file mode 100644 index 0000000..ebef5ac --- /dev/null +++ b/96/96-3(VB.net)/96-3/Form1.vb @@ -0,0 +1,71 @@ +Public Class Form1 + Dim pi As Double = 4 * Math.Atan(1) + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim R, G, B As Double + R = Val(TextR.Text) + G = Val(TextG.Text) + B = Val(TextB.Text) + Dim RSum, GSum, BSum, Sum As Double + Sum = R + G + B + RSum = R / Sum + GSum = G / Sum + BSum = B / Sum + Dim UPcalc As Double = 0.5 * (2 * RSum - GSum - BSum) + Dim Dncalc As Double = ((RSum - GSum) ^ 2 + (RSum - BSum) * (GSum - BSum)) ^ 0.5 + Dim h As Double = Math.Acos(UPcalc / Dncalc) + If BSum > GSum Then + h = 2 * pi - Math.Acos(UPcalc / Dncalc) + End If + If Sum = 0 Or Dncalc = 0 Then h = 0 + TextH.Text = Math.Round(h * 180 / pi * 100) / 100 + Dim ss As Double = 0 + If Sum > 0 Then + ss = 1 - 3 * min(R, G, B) / Sum + End If + TextS.Text = Math.Round(ss * 255 * 100) / 100 + Dim ii As Double = (R + G + B) / 3 + TextI.Text = Math.Round(ii * 100) / 100 + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + Dim H, S, I, Dh, Ds, Di, xx, yy, zz, R, G, B As Double + H = Val(TextH.Text) + S = Val(TextS.Text) + I = Val(TextI.Text) + Dh = H * pi / 180 + Ds = S / 255 + Di = I / 255 + If H > 120 And H <= 240 Then + Dh -= 2 * pi / 3 + ElseIf H > 240 And H <= 360 Then + Dh -= -4 * pi / 3 + End If + xx = Di * (1 - Ds) + Dim UPcalc As Double = Ds * Math.Cos(Dh) + Dim Dncalc As Double = Math.Cos(pi / 3 - Dh) + yy = Di * (1 + UPcalc / Dncalc) + zz = 3 * Di - (xx + yy) + If H <= 120 Then + R = yy + G = zz + B = xx + ElseIf H > 120 And H <= 240 Then + R = xx + G = yy + B = zz + ElseIf H > 240 And H <= 360 Then + R = zz + G = xx + B = yy + End If + TextR.Text = Math.Round(R * 25500) / 100 + TextG.Text = Math.Round(G * 25500) / 100 + TextB.Text = Math.Round(B * 25500) / 100 + End Sub + + Function min(ByVal r As Double, ByVal g As Double, ByVal b As Double) As Double + min = r + If min > g Then min = g + If min > b Then min = b + End Function +End Class diff --git a/96/96-3(VB.net)/96-3/My Project/Application.Designer.vb b/96/96-3(VB.net)/96-3/My Project/Application.Designer.vb new file mode 100644 index 0000000..d60a437 --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_3.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-3(VB.net)/96-3/My Project/Application.myapp b/96/96-3(VB.net)/96-3/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-3(VB.net)/96-3/My Project/AssemblyInfo.vb b/96/96-3(VB.net)/96-3/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..ef3728d --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-3(VB.net)/96-3/My Project/Resources.Designer.vb b/96/96-3(VB.net)/96-3/My Project/Resources.Designer.vb new file mode 100644 index 0000000..7c6f613 --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_3.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-3(VB.net)/96-3/My Project/Resources.resx b/96/96-3(VB.net)/96-3/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-3(VB.net)/96-3/My Project/Settings.Designer.vb b/96/96-3(VB.net)/96-3/My Project/Settings.Designer.vb new file mode 100644 index 0000000..36b4c74 --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_3.My.MySettings + Get + Return Global._96_3.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-3(VB.net)/96-3/My Project/Settings.settings b/96/96-3(VB.net)/96-3/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-3(VB.net)/96-3/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-3(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" "b/96/96-3(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" new file mode 100644 index 0000000..ad50b1b --- /dev/null +++ "b/96/96-3(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第3題", "96-3\96年工科技藝競賽第3題.vbproj", "{C6291A88-5BA6-42EE-BB34-BEFE84077DCD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C6291A88-5BA6-42EE-BB34-BEFE84077DCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6291A88-5BA6-42EE-BB34-BEFE84077DCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6291A88-5BA6-42EE-BB34-BEFE84077DCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6291A88-5BA6-42EE-BB34-BEFE84077DCD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-4(VB.net)/2009-07-18_191912.png b/96/96-4(VB.net)/2009-07-18_191912.png new file mode 100644 index 0000000..3d47231 Binary files /dev/null and b/96/96-4(VB.net)/2009-07-18_191912.png differ diff --git "a/96/96-4(VB.net)/96-4/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" "b/96/96-4(VB.net)/96-4/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" new file mode 100644 index 0000000..3a64773 --- /dev/null +++ "b/96/96-4(VB.net)/96-4/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {FE921F3D-0295-4491-913C-47C43D8B9FE8} + WinExe + _96_4.My.MyApplication + _96_4 + 96-4 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-4(VB.net)/96-4/Form1.Designer.vb b/96/96-4(VB.net)/96-4/Form1.Designer.vb new file mode 100644 index 0000000..21df618 --- /dev/null +++ b/96/96-4(VB.net)/96-4/Form1.Designer.vb @@ -0,0 +1,84 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.Button2 = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(37, 78) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "計算" + Me.Button1.UseVisualStyleBackColor = True + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(12, 12) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(270, 20) + Me.InputBox.TabIndex = 1 + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(12, 52) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(270, 20) + Me.OutputBox.TabIndex = 2 + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(164, 78) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 3 + Me.Button2.Text = "EXIT" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(294, 111) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "96年工科技藝競賽第4題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + Friend WithEvents Button2 As System.Windows.Forms.Button + +End Class diff --git a/96/96-4(VB.net)/96-4/Form1.resx b/96/96-4(VB.net)/96-4/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/96/96-4(VB.net)/96-4/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-4(VB.net)/96-4/Form1.vb b/96/96-4(VB.net)/96-4/Form1.vb new file mode 100644 index 0000000..8e13eb5 --- /dev/null +++ b/96/96-4(VB.net)/96-4/Form1.vb @@ -0,0 +1,59 @@ +Public Class Form1 + '優先權2的運算 + Private Sub Eval2(ByRef input As String, ByRef ouput As String) + If Mid(input, 1, 1) = "(" Then + input = Strings.Right(input, input.Length - 1) + Eval0(input, ouput) + If Mid(input, 1, 1) = ")" Then + input = Strings.Right(input, input.Length - 1) + End If + Else + ouput += Str(Val(input)) & " " + input = Strings.Right(input, input.Length - Str(Val(input)).Length + 1) + End If + End Sub + '優先權1的運算 + Private Sub Eval1(ByRef input As String, ByRef ouput As String) + Eval2(input, ouput) + While Mid(input, 1, 1) = "*" Or Mid(input, 1, 1) = "/" + If Mid(input, 1, 1) = "*" Then + input = Strings.Right(input, input.Length - 1) + Eval2(input, ouput) + ouput += "* " + ElseIf Mid(input, 1, 1) = "/" Then + input = Strings.Right(input, input.Length - 1) + Eval2(input, ouput) + ouput += "/ " + End If + End While + End Sub + '優先權0的運算 + Private Sub Eval0(ByRef input As String, ByRef ouput As String) + Eval1(input, ouput) + While Mid(input, 1, 1) = "+" Or Mid(input, 1, 1) = "-" + If Mid(input, 1, 1) = "+" Then + input = Strings.Right(input, input.Length - 1) + Eval1(input, ouput) + ouput += "+ " + ElseIf Mid(input, 1, 1) = "-" Then + input = Strings.Right(input, input.Length - 1) + Eval1(input, ouput) + ouput += "- " + End If + End While + End Sub + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim strTmp As String = InputBox.Text.Replace(" ", "") + If strTmp.Length < 3 Then + OutputBox.Text = "輸入錯誤" + Exit Sub + End If + OutputBox.Text = "" + Eval0(strTmp, OutputBox.Text) + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + End + End Sub +End Class diff --git a/96/96-4(VB.net)/96-4/My Project/Application.Designer.vb b/96/96-4(VB.net)/96-4/My Project/Application.Designer.vb new file mode 100644 index 0000000..cb19125 --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_4.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-4(VB.net)/96-4/My Project/Application.myapp b/96/96-4(VB.net)/96-4/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-4(VB.net)/96-4/My Project/AssemblyInfo.vb b/96/96-4(VB.net)/96-4/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..301a84d --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-4(VB.net)/96-4/My Project/Resources.Designer.vb b/96/96-4(VB.net)/96-4/My Project/Resources.Designer.vb new file mode 100644 index 0000000..bbd497f --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_4.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-4(VB.net)/96-4/My Project/Resources.resx b/96/96-4(VB.net)/96-4/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-4(VB.net)/96-4/My Project/Settings.Designer.vb b/96/96-4(VB.net)/96-4/My Project/Settings.Designer.vb new file mode 100644 index 0000000..ce80dcf --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_4.My.MySettings + Get + Return Global._96_4.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-4(VB.net)/96-4/My Project/Settings.settings b/96/96-4(VB.net)/96-4/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-4(VB.net)/96-4/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-4(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" "b/96/96-4(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" new file mode 100644 index 0000000..5a22ce2 --- /dev/null +++ "b/96/96-4(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第4題", "96-4\96年工科技藝競賽第4題.vbproj", "{FE921F3D-0295-4491-913C-47C43D8B9FE8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE921F3D-0295-4491-913C-47C43D8B9FE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE921F3D-0295-4491-913C-47C43D8B9FE8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE921F3D-0295-4491-913C-47C43D8B9FE8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE921F3D-0295-4491-913C-47C43D8B9FE8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-5(VB.net)/2009-07-18_145630.png b/96/96-5(VB.net)/2009-07-18_145630.png new file mode 100644 index 0000000..5c3e8f7 Binary files /dev/null and b/96/96-5(VB.net)/2009-07-18_145630.png differ diff --git "a/96/96-5(VB.net)/96-5/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" "b/96/96-5(VB.net)/96-5/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" new file mode 100644 index 0000000..f29c6f0 --- /dev/null +++ "b/96/96-5(VB.net)/96-5/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {103A340D-6EC2-4C8C-B734-51F24E02237C} + WinExe + _96_5.My.MyApplication + _96_5 + 96-5 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-5(VB.net)/96-5/Form1.Designer.vb b/96/96-5(VB.net)/96-5/Form1.Designer.vb new file mode 100644 index 0000000..8194282 --- /dev/null +++ b/96/96-5(VB.net)/96-5/Form1.Designer.vb @@ -0,0 +1,131 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Button1 = New System.Windows.Forms.Button + Me.TextA = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.TextB = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.TextC = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(151, 35) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "A^B MOD C" + Me.Button1.UseVisualStyleBackColor = True + ' + 'TextA + ' + Me.TextA.Location = New System.Drawing.Point(32, 12) + Me.TextA.Name = "TextA" + Me.TextA.Size = New System.Drawing.Size(100, 20) + Me.TextA.TabIndex = 1 + Me.TextA.Text = "42148" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 15) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(14, 13) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "A" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(12, 41) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(14, 13) + Me.Label2.TabIndex = 4 + Me.Label2.Text = "B" + ' + 'TextB + ' + Me.TextB.Location = New System.Drawing.Point(32, 38) + Me.TextB.Name = "TextB" + Me.TextB.Size = New System.Drawing.Size(100, 20) + Me.TextB.TabIndex = 3 + Me.TextB.Text = "8315" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(12, 67) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(14, 13) + Me.Label3.TabIndex = 6 + Me.Label3.Text = "C" + ' + 'TextC + ' + Me.TextC.Location = New System.Drawing.Point(32, 64) + Me.TextC.Name = "TextC" + Me.TextC.Size = New System.Drawing.Size(100, 20) + Me.TextC.TabIndex = 5 + Me.TextC.Text = "68269" + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(243, 38) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(100, 20) + Me.OutputBox.TabIndex = 7 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(365, 103) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.TextC) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.TextB) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.TextA) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "96年工科技藝競賽第5題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents TextA As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents TextB As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents TextC As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + +End Class diff --git a/96/96-5(VB.net)/96-5/Form1.resx b/96/96-5(VB.net)/96-5/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/96/96-5(VB.net)/96-5/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-5(VB.net)/96-5/Form1.vb b/96/96-5(VB.net)/96-5/Form1.vb new file mode 100644 index 0000000..2e6fb8b --- /dev/null +++ b/96/96-5(VB.net)/96-5/Form1.vb @@ -0,0 +1,47 @@ +Public Class Form1 + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim A, B, C As Long + A = Val(TextA.Text) + B = Val(TextB.Text) + C = Val(TextC.Text) + OutputBox.Text = CalcBin(A, B, C) '依提示解 + 'OutputBox.Text = CalcMod(A, B, C) '遞迴解 + End Sub + + Private Function CalcBin(ByVal a As Long, ByVal b As Long, ByVal c As Long) As Long + Dim StrB As String = ToBinary(b) + Dim S As Long = 1 + For i = 1 To StrB.Length + S = (S * S) Mod c + If Mid(StrB, i, 1) = "1" Then + S = (a * S) Mod c + End If + Next + Return S + End Function + + Private Function ToBinary(ByVal a As Long) As String + ToBinary = "" + While a > 0 + If a Mod 2 = 1 Then + ToBinary = "1" & ToBinary + Else + ToBinary = "0" & ToBinary + End If + a \= 2 + End While + End Function + + Private Function CalcMod(ByVal a As Long, ByVal b As Long, ByVal c As Long) As Long + If b = 1 Then + Return a Mod c + Else + If b Mod 2 = 0 Then + Return (CalcMod(a, b \ 2, c) * CalcMod(a, b \ 2, c)) Mod c + Else + Return (CalcMod(a, b \ 2, c) * CalcMod(a, b \ 2, c) * a) Mod c + End If + End If + End Function +End Class diff --git a/96/96-5(VB.net)/96-5/My Project/Application.Designer.vb b/96/96-5(VB.net)/96-5/My Project/Application.Designer.vb new file mode 100644 index 0000000..5b7e381 --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_5.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-5(VB.net)/96-5/My Project/Application.myapp b/96/96-5(VB.net)/96-5/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-5(VB.net)/96-5/My Project/AssemblyInfo.vb b/96/96-5(VB.net)/96-5/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..ab440b3 --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-5(VB.net)/96-5/My Project/Resources.Designer.vb b/96/96-5(VB.net)/96-5/My Project/Resources.Designer.vb new file mode 100644 index 0000000..8e6ff7b --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_5.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-5(VB.net)/96-5/My Project/Resources.resx b/96/96-5(VB.net)/96-5/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-5(VB.net)/96-5/My Project/Settings.Designer.vb b/96/96-5(VB.net)/96-5/My Project/Settings.Designer.vb new file mode 100644 index 0000000..14495f3 --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_5.My.MySettings + Get + Return Global._96_5.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-5(VB.net)/96-5/My Project/Settings.settings b/96/96-5(VB.net)/96-5/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-5(VB.net)/96-5/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-5(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" "b/96/96-5(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" new file mode 100644 index 0000000..5247230 --- /dev/null +++ "b/96/96-5(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第5題", "96-5\96年工科技藝競賽第5題.vbproj", "{103A340D-6EC2-4C8C-B734-51F24E02237C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {103A340D-6EC2-4C8C-B734-51F24E02237C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {103A340D-6EC2-4C8C-B734-51F24E02237C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {103A340D-6EC2-4C8C-B734-51F24E02237C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {103A340D-6EC2-4C8C-B734-51F24E02237C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-6(VB.net)/2009-07-18_145702.png b/96/96-6(VB.net)/2009-07-18_145702.png new file mode 100644 index 0000000..feafca5 Binary files /dev/null and b/96/96-6(VB.net)/2009-07-18_145702.png differ diff --git "a/96/96-6(VB.net)/96-6/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" "b/96/96-6(VB.net)/96-6/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" new file mode 100644 index 0000000..7fca5b1 --- /dev/null +++ "b/96/96-6(VB.net)/96-6/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DF026F9E-8837-404C-BE2A-684799523862} + WinExe + _96_6.My.MyApplication + _96_6 + 96-6 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-6(VB.net)/96-6/Form1.Designer.vb b/96/96-6(VB.net)/96-6/Form1.Designer.vb new file mode 100644 index 0000000..4ff3f51 --- /dev/null +++ b/96/96-6(VB.net)/96-6/Form1.Designer.vb @@ -0,0 +1,221 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.PublicKey1 = New System.Windows.Forms.TextBox + Me.PublicKey2 = New System.Windows.Forms.TextBox + Me.Label2 = New System.Windows.Forms.Label + Me.InputBox1 = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.OutputBox1 = New System.Windows.Forms.TextBox + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.InputBox2 = New System.Windows.Forms.TextBox + Me.Label4 = New System.Windows.Forms.Label + Me.OutputBox2 = New System.Windows.Forms.TextBox + Me.Label5 = New System.Windows.Forms.Label + Me.PrivateKey2 = New System.Windows.Forms.TextBox + Me.PrivateKey1 = New System.Windows.Forms.TextBox + Me.Label6 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 9) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(55, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "公開金錀" + ' + 'PublicKey1 + ' + Me.PublicKey1.Location = New System.Drawing.Point(74, 6) + Me.PublicKey1.Name = "PublicKey1" + Me.PublicKey1.Size = New System.Drawing.Size(100, 20) + Me.PublicKey1.TabIndex = 1 + Me.PublicKey1.Text = "8315" + ' + 'PublicKey2 + ' + Me.PublicKey2.Location = New System.Drawing.Point(180, 6) + Me.PublicKey2.Name = "PublicKey2" + Me.PublicKey2.Size = New System.Drawing.Size(100, 20) + Me.PublicKey2.TabIndex = 2 + Me.PublicKey2.Text = "68269" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(28, 54) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(31, 13) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "明文" + ' + 'InputBox1 + ' + Me.InputBox1.Location = New System.Drawing.Point(74, 51) + Me.InputBox1.Name = "InputBox1" + Me.InputBox1.Size = New System.Drawing.Size(206, 20) + Me.InputBox1.TabIndex = 4 + Me.InputBox1.Text = "電腦軟體設計" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(28, 95) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(31, 13) + Me.Label3.TabIndex = 5 + Me.Label3.Text = "密文" + ' + 'OutputBox1 + ' + Me.OutputBox1.Location = New System.Drawing.Point(74, 92) + Me.OutputBox1.Name = "OutputBox1" + Me.OutputBox1.Size = New System.Drawing.Size(635, 20) + Me.OutputBox1.TabIndex = 6 + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(311, 48) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 7 + Me.Button1.Text = "加密" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(311, 211) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 15 + Me.Button2.Text = "解密" + Me.Button2.UseVisualStyleBackColor = True + ' + 'InputBox2 + ' + Me.InputBox2.Location = New System.Drawing.Point(74, 173) + Me.InputBox2.Name = "InputBox2" + Me.InputBox2.Size = New System.Drawing.Size(635, 20) + Me.InputBox2.TabIndex = 14 + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(28, 176) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(31, 13) + Me.Label4.TabIndex = 13 + Me.Label4.Text = "密文" + ' + 'OutputBox2 + ' + Me.OutputBox2.Location = New System.Drawing.Point(74, 214) + Me.OutputBox2.Name = "OutputBox2" + Me.OutputBox2.Size = New System.Drawing.Size(206, 20) + Me.OutputBox2.TabIndex = 12 + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(28, 217) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(31, 13) + Me.Label5.TabIndex = 11 + Me.Label5.Text = "明文" + ' + 'PrivateKey2 + ' + Me.PrivateKey2.Location = New System.Drawing.Point(180, 134) + Me.PrivateKey2.Name = "PrivateKey2" + Me.PrivateKey2.Size = New System.Drawing.Size(100, 20) + Me.PrivateKey2.TabIndex = 10 + Me.PrivateKey2.Text = "68269" + ' + 'PrivateKey1 + ' + Me.PrivateKey1.Location = New System.Drawing.Point(74, 134) + Me.PrivateKey1.Name = "PrivateKey1" + Me.PrivateKey1.Size = New System.Drawing.Size(100, 20) + Me.PrivateKey1.TabIndex = 9 + Me.PrivateKey1.Text = "9907" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(12, 137) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(55, 13) + Me.Label6.TabIndex = 8 + Me.Label6.Text = "私密金錀" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(771, 269) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.InputBox2) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.OutputBox2) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.PrivateKey2) + Me.Controls.Add(Me.PrivateKey1) + Me.Controls.Add(Me.Label6) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.OutputBox1) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.InputBox1) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.PublicKey2) + Me.Controls.Add(Me.PublicKey1) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "96年工科技藝競賽第6題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents PublicKey1 As System.Windows.Forms.TextBox + Friend WithEvents PublicKey2 As System.Windows.Forms.TextBox + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents InputBox1 As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents OutputBox1 As System.Windows.Forms.TextBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents InputBox2 As System.Windows.Forms.TextBox + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents OutputBox2 As System.Windows.Forms.TextBox + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents PrivateKey2 As System.Windows.Forms.TextBox + Friend WithEvents PrivateKey1 As System.Windows.Forms.TextBox + Friend WithEvents Label6 As System.Windows.Forms.Label + +End Class diff --git a/96/96-6(VB.net)/96-6/Form1.resx b/96/96-6(VB.net)/96-6/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/96/96-6(VB.net)/96-6/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-6(VB.net)/96-6/Form1.vb b/96/96-6(VB.net)/96-6/Form1.vb new file mode 100644 index 0000000..decc12b --- /dev/null +++ b/96/96-6(VB.net)/96-6/Form1.vb @@ -0,0 +1,60 @@ +Public Class Form1 + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim StrIn As String = InputBox1.Text + Dim Key1 As Long = Val(PublicKey1.Text) + Dim Key2 As Long = Val(PublicKey2.Text) + Dim StrOut As String = "" + For i = 1 To StrIn.Length + If Asc(Mid(StrIn, i, 1)) > 0 Then + StrOut += FormatStr(CalcBin(Asc(Mid(StrIn, i, 1)), Key1, Key2)) + Else + StrOut += FormatStr(CalcBin(Asc(Mid(StrIn, i, 1)) + 65536, Key1, Key2)) + End If + Next + OutputBox1.Text = StrOut + End Sub + + Private Function FormatStr(ByVal i As Long) As String + Dim s As String = Str(i) + s = s.Replace(" ", "") + While s.Length < 5 + s = "0" & s + End While + Return s + End Function + + Private Function CalcBin(ByVal a As Long, ByVal b As Long, ByVal c As Long) As Long + Dim StrB As String = ToBinary(b) + Dim S As Long = 1 + For i = 1 To StrB.Length + S = (S * S) Mod c + If Mid(StrB, i, 1) = "1" Then + S = (a * S) Mod c + End If + Next + Return S + End Function + + Private Function ToBinary(ByVal a As Long) As String + ToBinary = "" + While a > 0 + If a Mod 2 = 1 Then + ToBinary = "1" & ToBinary + Else + ToBinary = "0" & ToBinary + End If + a \= 2 + End While + End Function + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + Dim Key1 As Long = Val(PrivateKey1.Text) + Dim Key2 As Long = Val(PrivateKey2.Text) + Dim WordTotal As Integer = InputBox2.Text.Length / 5 + Dim StrOut As String = "" + For i = 1 To WordTotal + StrOut += Chr(CalcBin(Val(Mid(InputBox2.Text, 5 * (i - 1) + 1, 5)), Key1, Key2)) + Next + OutputBox2.Text = StrOut + End Sub +End Class diff --git a/96/96-6(VB.net)/96-6/My Project/Application.Designer.vb b/96/96-6(VB.net)/96-6/My Project/Application.Designer.vb new file mode 100644 index 0000000..e41d31a --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_6.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-6(VB.net)/96-6/My Project/Application.myapp b/96/96-6(VB.net)/96-6/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-6(VB.net)/96-6/My Project/AssemblyInfo.vb b/96/96-6(VB.net)/96-6/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..e2d5fed --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-6(VB.net)/96-6/My Project/Resources.Designer.vb b/96/96-6(VB.net)/96-6/My Project/Resources.Designer.vb new file mode 100644 index 0000000..9cc6295 --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_6.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-6(VB.net)/96-6/My Project/Resources.resx b/96/96-6(VB.net)/96-6/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-6(VB.net)/96-6/My Project/Settings.Designer.vb b/96/96-6(VB.net)/96-6/My Project/Settings.Designer.vb new file mode 100644 index 0000000..d1e9ad1 --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_6.My.MySettings + Get + Return Global._96_6.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-6(VB.net)/96-6/My Project/Settings.settings b/96/96-6(VB.net)/96-6/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-6(VB.net)/96-6/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-6(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" "b/96/96-6(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" new file mode 100644 index 0000000..2b3daa9 --- /dev/null +++ "b/96/96-6(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第6題", "96-6\96年工科技藝競賽第6題.vbproj", "{DF026F9E-8837-404C-BE2A-684799523862}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DF026F9E-8837-404C-BE2A-684799523862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DF026F9E-8837-404C-BE2A-684799523862}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DF026F9E-8837-404C-BE2A-684799523862}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DF026F9E-8837-404C-BE2A-684799523862}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/96/96-7(VB.net)/2009-07-18_150048.png b/96/96-7(VB.net)/2009-07-18_150048.png new file mode 100644 index 0000000..7afe7dc Binary files /dev/null and b/96/96-7(VB.net)/2009-07-18_150048.png differ diff --git "a/96/96-7(VB.net)/96-7/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" "b/96/96-7(VB.net)/96-7/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" new file mode 100644 index 0000000..90427bb --- /dev/null +++ "b/96/96-7(VB.net)/96-7/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7B6543A7-FC6B-4279-A0A2-34F47D32BE9B} + WinExe + _96_7.My.MyApplication + _96_7 + 96-7 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 96-7.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 96-7.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/96/96-7(VB.net)/96-7/Form1.Designer.vb b/96/96-7(VB.net)/96-7/Form1.Designer.vb new file mode 100644 index 0000000..0ae43c1 --- /dev/null +++ b/96/96-7(VB.net)/96-7/Form1.Designer.vb @@ -0,0 +1,434 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.GroupBox1 = New System.Windows.Forms.GroupBox + Me.Label4 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.GroupBox2 = New System.Windows.Forms.GroupBox + Me.Label5 = New System.Windows.Forms.Label + Me.Label7 = New System.Windows.Forms.Label + Me.Label6 = New System.Windows.Forms.Label + Me.GroupBox5 = New System.Windows.Forms.GroupBox + Me.Label20 = New System.Windows.Forms.Label + Me.Label21 = New System.Windows.Forms.Label + Me.Label22 = New System.Windows.Forms.Label + Me.GroupBox3 = New System.Windows.Forms.GroupBox + Me.Label14 = New System.Windows.Forms.Label + Me.Label16 = New System.Windows.Forms.Label + Me.Label15 = New System.Windows.Forms.Label + Me.GroupBox4 = New System.Windows.Forms.GroupBox + Me.Label17 = New System.Windows.Forms.Label + Me.Label18 = New System.Windows.Forms.Label + Me.Label19 = New System.Windows.Forms.Label + Me.GroupBox7 = New System.Windows.Forms.GroupBox + Me.Label11 = New System.Windows.Forms.Label + Me.Label13 = New System.Windows.Forms.Label + Me.Label12 = New System.Windows.Forms.Label + Me.GroupBox6 = New System.Windows.Forms.GroupBox + Me.Label8 = New System.Windows.Forms.Label + Me.Label10 = New System.Windows.Forms.Label + Me.Label9 = New System.Windows.Forms.Label + Me.Btn1 = New System.Windows.Forms.Button + Me.Button1 = New System.Windows.Forms.Button + Me.Label = New System.Windows.Forms.Label + Me.GroupBox1.SuspendLayout() + Me.GroupBox2.SuspendLayout() + Me.GroupBox5.SuspendLayout() + Me.GroupBox3.SuspendLayout() + Me.GroupBox4.SuspendLayout() + Me.GroupBox7.SuspendLayout() + Me.GroupBox6.SuspendLayout() + Me.SuspendLayout() + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.Label4) + Me.GroupBox1.Controls.Add(Me.Label3) + Me.GroupBox1.Controls.Add(Me.Label2) + Me.GroupBox1.Location = New System.Drawing.Point(12, 12) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(368, 151) + Me.GroupBox1.TabIndex = 0 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "主餐" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(275, 16) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(31, 13) + Me.Label4.TabIndex = 2 + Me.Label4.Text = "數量" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(166, 16) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(31, 13) + Me.Label3.TabIndex = 1 + Me.Label3.Text = "單價" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(49, 16) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(31, 13) + Me.Label2.TabIndex = 0 + Me.Label2.Text = "品名" + ' + 'GroupBox2 + ' + Me.GroupBox2.Controls.Add(Me.Label5) + Me.GroupBox2.Controls.Add(Me.Label7) + Me.GroupBox2.Controls.Add(Me.Label6) + Me.GroupBox2.Location = New System.Drawing.Point(386, 12) + Me.GroupBox2.Name = "GroupBox2" + Me.GroupBox2.Size = New System.Drawing.Size(352, 151) + Me.GroupBox2.TabIndex = 1 + Me.GroupBox2.TabStop = False + Me.GroupBox2.Text = "沙拉" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(281, 16) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(31, 13) + Me.Label5.TabIndex = 5 + Me.Label5.Text = "數量" + ' + 'Label7 + ' + Me.Label7.AutoSize = True + Me.Label7.Location = New System.Drawing.Point(55, 16) + Me.Label7.Name = "Label7" + Me.Label7.Size = New System.Drawing.Size(31, 13) + Me.Label7.TabIndex = 3 + Me.Label7.Text = "品名" + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(172, 16) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(31, 13) + Me.Label6.TabIndex = 4 + Me.Label6.Text = "單價" + ' + 'GroupBox5 + ' + Me.GroupBox5.Controls.Add(Me.Label20) + Me.GroupBox5.Controls.Add(Me.Label21) + Me.GroupBox5.Controls.Add(Me.Label22) + Me.GroupBox5.Location = New System.Drawing.Point(497, 169) + Me.GroupBox5.Name = "GroupBox5" + Me.GroupBox5.Size = New System.Drawing.Size(241, 151) + Me.GroupBox5.TabIndex = 3 + Me.GroupBox5.TabStop = False + Me.GroupBox5.Text = "甜點" + ' + 'Label20 + ' + Me.Label20.AutoSize = True + Me.Label20.Location = New System.Drawing.Point(192, 16) + Me.Label20.Name = "Label20" + Me.Label20.Size = New System.Drawing.Size(31, 13) + Me.Label20.TabIndex = 20 + Me.Label20.Text = "數量" + ' + 'Label21 + ' + Me.Label21.AutoSize = True + Me.Label21.Location = New System.Drawing.Point(23, 16) + Me.Label21.Name = "Label21" + Me.Label21.Size = New System.Drawing.Size(31, 13) + Me.Label21.TabIndex = 18 + Me.Label21.Text = "品名" + ' + 'Label22 + ' + Me.Label22.AutoSize = True + Me.Label22.Location = New System.Drawing.Point(106, 16) + Me.Label22.Name = "Label22" + Me.Label22.Size = New System.Drawing.Size(31, 13) + Me.Label22.TabIndex = 19 + Me.Label22.Text = "單價" + ' + 'GroupBox3 + ' + Me.GroupBox3.Controls.Add(Me.Label14) + Me.GroupBox3.Controls.Add(Me.Label16) + Me.GroupBox3.Controls.Add(Me.Label15) + Me.GroupBox3.Location = New System.Drawing.Point(12, 169) + Me.GroupBox3.Name = "GroupBox3" + Me.GroupBox3.Size = New System.Drawing.Size(238, 151) + Me.GroupBox3.TabIndex = 2 + Me.GroupBox3.TabStop = False + Me.GroupBox3.Text = "前菜" + ' + 'Label14 + ' + Me.Label14.AutoSize = True + Me.Label14.Location = New System.Drawing.Point(184, 16) + Me.Label14.Name = "Label14" + Me.Label14.Size = New System.Drawing.Size(31, 13) + Me.Label14.TabIndex = 14 + Me.Label14.Text = "數量" + ' + 'Label16 + ' + Me.Label16.AutoSize = True + Me.Label16.Location = New System.Drawing.Point(15, 16) + Me.Label16.Name = "Label16" + Me.Label16.Size = New System.Drawing.Size(31, 13) + Me.Label16.TabIndex = 12 + Me.Label16.Text = "品名" + ' + 'Label15 + ' + Me.Label15.AutoSize = True + Me.Label15.Location = New System.Drawing.Point(98, 16) + Me.Label15.Name = "Label15" + Me.Label15.Size = New System.Drawing.Size(31, 13) + Me.Label15.TabIndex = 13 + Me.Label15.Text = "單價" + ' + 'GroupBox4 + ' + Me.GroupBox4.Controls.Add(Me.Label17) + Me.GroupBox4.Controls.Add(Me.Label18) + Me.GroupBox4.Controls.Add(Me.Label19) + Me.GroupBox4.Location = New System.Drawing.Point(256, 169) + Me.GroupBox4.Name = "GroupBox4" + Me.GroupBox4.Size = New System.Drawing.Size(235, 151) + Me.GroupBox4.TabIndex = 3 + Me.GroupBox4.TabStop = False + Me.GroupBox4.Text = "湯品" + ' + 'Label17 + ' + Me.Label17.AutoSize = True + Me.Label17.Location = New System.Drawing.Point(189, 16) + Me.Label17.Name = "Label17" + Me.Label17.Size = New System.Drawing.Size(31, 13) + Me.Label17.TabIndex = 17 + Me.Label17.Text = "數量" + ' + 'Label18 + ' + Me.Label18.AutoSize = True + Me.Label18.Location = New System.Drawing.Point(20, 16) + Me.Label18.Name = "Label18" + Me.Label18.Size = New System.Drawing.Size(31, 13) + Me.Label18.TabIndex = 15 + Me.Label18.Text = "品名" + ' + 'Label19 + ' + Me.Label19.AutoSize = True + Me.Label19.Location = New System.Drawing.Point(103, 16) + Me.Label19.Name = "Label19" + Me.Label19.Size = New System.Drawing.Size(31, 13) + Me.Label19.TabIndex = 16 + Me.Label19.Text = "單價" + ' + 'GroupBox7 + ' + Me.GroupBox7.Controls.Add(Me.Label11) + Me.GroupBox7.Controls.Add(Me.Label13) + Me.GroupBox7.Controls.Add(Me.Label12) + Me.GroupBox7.Location = New System.Drawing.Point(386, 326) + Me.GroupBox7.Name = "GroupBox7" + Me.GroupBox7.Size = New System.Drawing.Size(352, 151) + Me.GroupBox7.TabIndex = 3 + Me.GroupBox7.TabStop = False + Me.GroupBox7.Text = "冷飲" + ' + 'Label11 + ' + Me.Label11.AutoSize = True + Me.Label11.Location = New System.Drawing.Point(281, 16) + Me.Label11.Name = "Label11" + Me.Label11.Size = New System.Drawing.Size(31, 13) + Me.Label11.TabIndex = 11 + Me.Label11.Text = "數量" + ' + 'Label13 + ' + Me.Label13.AutoSize = True + Me.Label13.Location = New System.Drawing.Point(55, 16) + Me.Label13.Name = "Label13" + Me.Label13.Size = New System.Drawing.Size(31, 13) + Me.Label13.TabIndex = 9 + Me.Label13.Text = "品名" + ' + 'Label12 + ' + Me.Label12.AutoSize = True + Me.Label12.Location = New System.Drawing.Point(172, 16) + Me.Label12.Name = "Label12" + Me.Label12.Size = New System.Drawing.Size(31, 13) + Me.Label12.TabIndex = 10 + Me.Label12.Text = "單價" + ' + 'GroupBox6 + ' + Me.GroupBox6.Controls.Add(Me.Label8) + Me.GroupBox6.Controls.Add(Me.Label10) + Me.GroupBox6.Controls.Add(Me.Label9) + Me.GroupBox6.Location = New System.Drawing.Point(12, 326) + Me.GroupBox6.Name = "GroupBox6" + Me.GroupBox6.Size = New System.Drawing.Size(368, 151) + Me.GroupBox6.TabIndex = 2 + Me.GroupBox6.TabStop = False + Me.GroupBox6.Text = "熱飲" + ' + 'Label8 + ' + Me.Label8.AutoSize = True + Me.Label8.Location = New System.Drawing.Point(275, 16) + Me.Label8.Name = "Label8" + Me.Label8.Size = New System.Drawing.Size(31, 13) + Me.Label8.TabIndex = 8 + Me.Label8.Text = "數量" + ' + 'Label10 + ' + Me.Label10.AutoSize = True + Me.Label10.Location = New System.Drawing.Point(49, 16) + Me.Label10.Name = "Label10" + Me.Label10.Size = New System.Drawing.Size(31, 13) + Me.Label10.TabIndex = 6 + Me.Label10.Text = "品名" + ' + 'Label9 + ' + Me.Label9.AutoSize = True + Me.Label9.Location = New System.Drawing.Point(166, 16) + Me.Label9.Name = "Label9" + Me.Label9.Size = New System.Drawing.Size(31, 13) + Me.Label9.TabIndex = 7 + Me.Label9.Text = "單價" + ' + 'Btn1 + ' + Me.Btn1.Location = New System.Drawing.Point(93, 487) + Me.Btn1.Name = "Btn1" + Me.Btn1.Size = New System.Drawing.Size(75, 23) + Me.Btn1.TabIndex = 4 + Me.Btn1.Text = "數量清除" + Me.Btn1.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(215, 487) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 5 + Me.Button1.Text = "總金額" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Label + ' + Me.Label.BackColor = System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.Label.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label.Location = New System.Drawing.Point(344, 484) + Me.Label.Name = "Label" + Me.Label.Size = New System.Drawing.Size(394, 35) + Me.Label.TabIndex = 6 + Me.Label.Text = "等客人點餐中" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(747, 514) + Me.Controls.Add(Me.Label) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.Btn1) + Me.Controls.Add(Me.GroupBox7) + Me.Controls.Add(Me.GroupBox6) + Me.Controls.Add(Me.GroupBox4) + Me.Controls.Add(Me.GroupBox5) + Me.Controls.Add(Me.GroupBox2) + Me.Controls.Add(Me.GroupBox3) + Me.Controls.Add(Me.GroupBox1) + Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Name = "Form1" + Me.Text = "西式餐點-點餐服務系統" + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() + Me.GroupBox2.ResumeLayout(False) + Me.GroupBox2.PerformLayout() + Me.GroupBox5.ResumeLayout(False) + Me.GroupBox5.PerformLayout() + Me.GroupBox3.ResumeLayout(False) + Me.GroupBox3.PerformLayout() + Me.GroupBox4.ResumeLayout(False) + Me.GroupBox4.PerformLayout() + Me.GroupBox7.ResumeLayout(False) + Me.GroupBox7.PerformLayout() + Me.GroupBox6.ResumeLayout(False) + Me.GroupBox6.PerformLayout() + Me.ResumeLayout(False) + + End Sub + Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox5 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox4 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox7 As System.Windows.Forms.GroupBox + Friend WithEvents GroupBox6 As System.Windows.Forms.GroupBox + Friend WithEvents Btn1 As System.Windows.Forms.Button + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label5 As System.Windows.Forms.Label + Friend WithEvents Label7 As System.Windows.Forms.Label + Friend WithEvents Label6 As System.Windows.Forms.Label + Friend WithEvents Label20 As System.Windows.Forms.Label + Friend WithEvents Label21 As System.Windows.Forms.Label + Friend WithEvents Label22 As System.Windows.Forms.Label + Friend WithEvents Label14 As System.Windows.Forms.Label + Friend WithEvents Label16 As System.Windows.Forms.Label + Friend WithEvents Label15 As System.Windows.Forms.Label + Friend WithEvents Label17 As System.Windows.Forms.Label + Friend WithEvents Label18 As System.Windows.Forms.Label + Friend WithEvents Label19 As System.Windows.Forms.Label + Friend WithEvents Label11 As System.Windows.Forms.Label + Friend WithEvents Label13 As System.Windows.Forms.Label + Friend WithEvents Label12 As System.Windows.Forms.Label + Friend WithEvents Label8 As System.Windows.Forms.Label + Friend WithEvents Label10 As System.Windows.Forms.Label + Friend WithEvents Label9 As System.Windows.Forms.Label + +End Class diff --git a/96/96-7(VB.net)/96-7/Form1.resx b/96/96-7(VB.net)/96-7/Form1.resx new file mode 100644 index 0000000..858a538 --- /dev/null +++ b/96/96-7(VB.net)/96-7/Form1.resx @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/96/96-7(VB.net)/96-7/Form1.vb b/96/96-7(VB.net)/96-7/Form1.vb new file mode 100644 index 0000000..c1037cc --- /dev/null +++ b/96/96-7(VB.net)/96-7/Form1.vb @@ -0,0 +1,416 @@ +Public Class Form1 + Dim Menu1() As String = {"香酥脆皮雞排", "特選沙朗牛排", "特選菲力牛排", "什錦海鮮", "法式藍帶豬排", "海陸大餐"} + Dim Menu1Price() As Integer = {250, 380, 430, 450, 300, 570} + Dim Menu2() As String = {"生菜沙拉", "凱薩醬", "和風醬", "優格水果沙拉", "千島醬", "義大利醬"} + Dim Menu2Price() As Integer = {60, 60, 60, 60, 60, 60} + Dim Menu3() As String = {"洋蔥鱈魚肝", "泰式嫩菲力", "煙燻鮭魚", "香蒜烤田螺", "黑菌鵝肝醬"} + Dim Menu3Price() As Integer = {80, 80, 80, 80, 80} + Dim Menu4() As String = {"雞蓉巧達湯", "海鮮燉魚湯", "烤洋蔥湯", "南瓜湯", "脆皮濃湯"} + Dim Menu4Price() As Integer = {100, 100, 100, 100, 100} + Dim Menu5() As String = {"雞蛋布丁", "焦糖蛋糕", "義式布丁", "提拉米蘇", "柳橙水果凍"} + Dim Menu5Price() As Integer = {30, 50, 40, 50, 50} + Dim Menu6() As String = {"奶泡熱奶茶", "熱咖啡", "蜂蜜柚子茶", "拿鐵熱咖啡", "熱金桔檸檬梅子汁"} + Dim Menu6Price() As Integer = {70, 70, 90, 70, 100} + Dim Menu7() As String = {"可口可樂", "冰咖啡", "冰金桔檸檬", "芒果汁", "冰拿鐵"} + Dim Menu7Price() As Integer = {50, 70, 100, 90, 70} + Dim Text1(6), Text2(6), Text3(5), Text4(5), Text5(5), Text6(5), Text7(5) As Label + Dim Price1(6), Price2(6), Price3(5), Price4(5), Price5(5), Price6(5), Price7(5) As TextBox + Dim Num1(6), Num2(6), Num3(5), Num4(5), Num5(5), Num6(5), Num7(5) As TextBox + Dim VSB1(6), VSB2(6), VSB3(5), VSB4(5), VSB5(5), VSB6(5), VSB7(5) As VScrollBar + + + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + For i As Integer = 1 To 6 + Text1(i) = New Label + With Text1(i) + .Text = Menu1(i - 1) + .Left = 20 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox1.Controls.Add(Text1(i)) + End With + Price1(i) = New TextBox + With Price1(i) + .Text = Menu1Price(i - 1) + .Left = 170 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox1.Controls.Add(Price1(i)) + End With + Num1(i) = New TextBox + With Num1(i) + .Text = "0" + .Left = 270 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox1.Controls.Add(Num1(i)) + End With + VSB1(i) = New VScrollBar + With VSB1(i) + .Left = 300 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox1.Controls.Add(VSB1(i)) + End With + AddHandler VSB1(i).Scroll, AddressOf VSB1_Click + Next + + For i As Integer = 1 To 6 + Text2(i) = New Label + With Text2(i) + .Text = Menu2(i - 1) + .Left = 40 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox2.Controls.Add(Text2(i)) + End With + Price2(i) = New TextBox + With Price2(i) + .Text = Menu2Price(i - 1) + .Left = 170 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox2.Controls.Add(Price2(i)) + End With + Num2(i) = New TextBox + With Num2(i) + .Text = "0" + .Left = 270 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox2.Controls.Add(Num2(i)) + End With + VSB2(i) = New VScrollBar + With VSB2(i) + .Left = 300 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox2.Controls.Add(VSB2(i)) + End With + AddHandler VSB2(i).Scroll, AddressOf VSB2_Click + Next + + For i As Integer = 1 To 5 + Text3(i) = New Label + With Text3(i) + .Text = Menu3(i - 1) + .Left = 20 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox3.Controls.Add(Text3(i)) + End With + Price3(i) = New TextBox + With Price3(i) + .Text = Menu3Price(i - 1) + .Left = 110 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox3.Controls.Add(Price3(i)) + End With + Num3(i) = New TextBox + With Num3(i) + .Text = "0" + .Left = 180 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox3.Controls.Add(Num3(i)) + End With + VSB3(i) = New VScrollBar + With VSB3(i) + .Left = 210 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox3.Controls.Add(VSB3(i)) + End With + AddHandler VSB3(i).Scroll, AddressOf VSB3_Click + Next + + For i As Integer = 1 To 5 + Text4(i) = New Label + With Text4(i) + .Text = Menu4(i - 1) + .Left = 20 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox4.Controls.Add(Text4(i)) + End With + Price4(i) = New TextBox + With Price4(i) + .Text = Menu4Price(i - 1) + .Left = 110 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox4.Controls.Add(Price4(i)) + End With + Num4(i) = New TextBox + With Num4(i) + .Text = "0" + .Left = 180 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox4.Controls.Add(Num4(i)) + End With + VSB4(i) = New VScrollBar + With VSB4(i) + .Left = 210 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox4.Controls.Add(VSB4(i)) + End With + AddHandler VSB4(i).Scroll, AddressOf VSB4_Click + Next + + For i As Integer = 1 To 5 + Text5(i) = New Label + With Text5(i) + .Text = Menu5(i - 1) + .Left = 20 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox5.Controls.Add(Text5(i)) + End With + Price5(i) = New TextBox + With Price5(i) + .Text = Menu5Price(i - 1) + .Left = 110 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox5.Controls.Add(Price5(i)) + End With + Num5(i) = New TextBox + With Num5(i) + .Text = "0" + .Left = 180 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox5.Controls.Add(Num5(i)) + End With + VSB5(i) = New VScrollBar + With VSB5(i) + .Left = 210 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox5.Controls.Add(VSB5(i)) + End With + AddHandler VSB5(i).Scroll, AddressOf VSB5_Click + Next + + For i As Integer = 1 To 5 + Text6(i) = New Label + With Text6(i) + .Text = Menu6(i - 1) + .Left = 40 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox6.Controls.Add(Text6(i)) + End With + Price6(i) = New TextBox + With Price6(i) + .Text = Menu6Price(i - 1) + .Left = 170 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox6.Controls.Add(Price6(i)) + End With + Num6(i) = New TextBox + With Num6(i) + .Text = "0" + .Left = 270 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox6.Controls.Add(Num6(i)) + End With + VSB6(i) = New VScrollBar + With VSB6(i) + .Left = 300 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox6.Controls.Add(VSB6(i)) + End With + AddHandler VSB6(i).Scroll, AddressOf VSB6_Click + Next + + For i As Integer = 1 To 5 + Text7(i) = New Label + With Text7(i) + .Text = Menu7(i - 1) + .Left = 40 + .Top = 10 + i * 20 + .Height = 20 + .Visible = True + .AutoSize = True + GroupBox7.Controls.Add(Text7(i)) + End With + Price7(i) = New TextBox + With Price7(i) + .Text = Menu7Price(i - 1) + .Left = 170 + .Top = 10 + i * 20 + .Width = 30 + .Height = 20 + .Visible = True + GroupBox7.Controls.Add(Price7(i)) + End With + Num7(i) = New TextBox + With Num7(i) + .Text = "0" + .Left = 270 + .Top = 10 + i * 20 + .Height = 20 + .Width = 30 + .Visible = True + GroupBox7.Controls.Add(Num7(i)) + End With + VSB7(i) = New VScrollBar + With VSB7(i) + .Left = 300 + .Top = 10 + i * 20 + .Height = 20 + .Width = 15 + .Visible = True + GroupBox7.Controls.Add(VSB7(i)) + End With + AddHandler VSB7(i).Scroll, AddressOf VSB7_Click + Next + + + End Sub + + Private Sub VSB1_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 6 + If DirectCast(sender, VScrollBar).Equals(VSB1(i)) Then + Num1(i).Text = VSB1(i).Value + End If + Next + End Sub + Private Sub VSB2_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 6 + If DirectCast(sender, VScrollBar).Equals(VSB2(i)) Then + Num2(i).Text = VSB2(i).Value + End If + Next + End Sub + Private Sub VSB3_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 5 + If DirectCast(sender, VScrollBar).Equals(VSB3(i)) Then + Num3(i).Text = VSB3(i).Value + End If + Next + End Sub + Private Sub VSB4_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 5 + If DirectCast(sender, VScrollBar).Equals(VSB4(i)) Then + Num4(i).Text = VSB4(i).Value + End If + Next + End Sub + Private Sub VSB5_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 5 + If DirectCast(sender, VScrollBar).Equals(VSB5(i)) Then + Num5(i).Text = VSB5(i).Value + End If + Next + End Sub + Private Sub VSB6_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 5 + If DirectCast(sender, VScrollBar).Equals(VSB6(i)) Then + Num6(i).Text = VSB6(i).Value + End If + Next + End Sub + Private Sub VSB7_Click(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) + For i = 1 To 5 + If DirectCast(sender, VScrollBar).Equals(VSB7(i)) Then + Num7(i).Text = VSB7(i).Value + End If + Next + End Sub + + Private Sub Btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click + Label.Text = "等客人點餐" + For i = 1 To 6 + VSB1(i).Value = 0 + VSB2(i).Value = 0 + Num1(i).Text = 0 + Num2(i).Text = 0 + Next + For i = 1 To 5 + VSB3(i).Value = 0 + VSB4(i).Value = 0 + VSB5(i).Value = 0 + VSB6(i).Value = 0 + VSB7(i).Value = 0 + Num3(i).Text = 0 + Num4(i).Text = 0 + Num5(i).Text = 0 + Num6(i).Text = 0 + Num7(i).Text = 0 + Next + End Sub + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim sum As Double = 0 + For i = 1 To 6 + sum += VSB1(i).Value * Val(Price1(i).Text) + sum += VSB2(i).Value * Val(Price2(i).Text) + Next + For i = 1 To 5 + sum += VSB3(i).Value * Val(Price3(i).Text) + sum += VSB4(i).Value * Val(Price4(i).Text) + sum += VSB5(i).Value * Val(Price5(i).Text) + sum += VSB6(i).Value * Val(Price6(i).Text) + sum += VSB7(i).Value * Val(Price7(i).Text) + Next + sum *= 1.05 + sum = Math.Round(sum + 0.01) + Label.Text = "加稅後總金額:" & Val(sum) + End Sub +End Class diff --git a/96/96-7(VB.net)/96-7/My Project/Application.Designer.vb b/96/96-7(VB.net)/96-7/My Project/Application.Designer.vb new file mode 100644 index 0000000..6462cb2 --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._96_7.Form1 + End Sub + End Class +End Namespace diff --git a/96/96-7(VB.net)/96-7/My Project/Application.myapp b/96/96-7(VB.net)/96-7/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/96/96-7(VB.net)/96-7/My Project/AssemblyInfo.vb b/96/96-7(VB.net)/96-7/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..6633079 --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/96/96-7(VB.net)/96-7/My Project/Resources.Designer.vb b/96/96-7(VB.net)/96-7/My Project/Resources.Designer.vb new file mode 100644 index 0000000..b516e4b --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_96_7.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/96/96-7(VB.net)/96-7/My Project/Resources.resx b/96/96-7(VB.net)/96-7/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/96/96-7(VB.net)/96-7/My Project/Settings.Designer.vb b/96/96-7(VB.net)/96-7/My Project/Settings.Designer.vb new file mode 100644 index 0000000..cf984f9 --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._96_7.My.MySettings + Get + Return Global._96_7.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/96/96-7(VB.net)/96-7/My Project/Settings.settings b/96/96-7(VB.net)/96-7/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/96/96-7(VB.net)/96-7/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/96/96-7(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" "b/96/96-7(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" new file mode 100644 index 0000000..43bf8f0 --- /dev/null +++ "b/96/96-7(VB.net)/96\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2547\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "96年工科技藝競賽第7題", "96-7\96年工科技藝競賽第7題.vbproj", "{7B6543A7-FC6B-4279-A0A2-34F47D32BE9B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7B6543A7-FC6B-4279-A0A2-34F47D32BE9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B6543A7-FC6B-4279-A0A2-34F47D32BE9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B6543A7-FC6B-4279-A0A2-34F47D32BE9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7B6543A7-FC6B-4279-A0A2-34F47D32BE9B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-1(VB.net)/2009-07-18_144300.png b/97/97-1(VB.net)/2009-07-18_144300.png new file mode 100644 index 0000000..0851b7b Binary files /dev/null and b/97/97-1(VB.net)/2009-07-18_144300.png differ diff --git "a/97/97-1(VB.net)/97-1/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" "b/97/97-1(VB.net)/97-1/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" new file mode 100644 index 0000000..64c8e64 --- /dev/null +++ "b/97/97-1(VB.net)/97-1/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {159FB1EB-4D02-4447-AD0B-A630778F8490} + WinExe + _97_1.My.MyApplication + _97_1 + 97-1 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-1.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-1(VB.net)/97-1/Form1.Designer.vb b/97/97-1(VB.net)/97-1/Form1.Designer.vb new file mode 100644 index 0000000..83126ba --- /dev/null +++ b/97/97-1(VB.net)/97-1/Form1.Designer.vb @@ -0,0 +1,111 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.replot = New System.Windows.Forms.Button + Me.label2 = New System.Windows.Forms.Label + Me.label1 = New System.Windows.Forms.Label + Me.tbMax = New System.Windows.Forms.TextBox + Me.tbMin = New System.Windows.Forms.TextBox + Me.graphs = New System.Windows.Forms.PictureBox + CType(Me.graphs, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'replot + ' + Me.replot.Location = New System.Drawing.Point(64, 286) + Me.replot.Name = "replot" + Me.replot.Size = New System.Drawing.Size(75, 23) + Me.replot.TabIndex = 17 + Me.replot.Text = "Replot" + Me.replot.UseVisualStyleBackColor = True + ' + 'label2 + ' + Me.label2.AutoSize = True + Me.label2.Location = New System.Drawing.Point(348, 291) + Me.label2.Name = "label2" + Me.label2.Size = New System.Drawing.Size(34, 13) + Me.label2.TabIndex = 16 + Me.label2.Text = "MaxX" + ' + 'label1 + ' + Me.label1.AutoSize = True + Me.label1.Location = New System.Drawing.Point(225, 291) + Me.label1.Name = "label1" + Me.label1.Size = New System.Drawing.Size(31, 13) + Me.label1.TabIndex = 15 + Me.label1.Text = "MinX" + ' + 'tbMax + ' + Me.tbMax.Location = New System.Drawing.Point(385, 289) + Me.tbMax.Name = "tbMax" + Me.tbMax.Size = New System.Drawing.Size(67, 20) + Me.tbMax.TabIndex = 14 + Me.tbMax.Text = "20" + ' + 'tbMin + ' + Me.tbMin.Location = New System.Drawing.Point(262, 289) + Me.tbMin.Name = "tbMin" + Me.tbMin.Size = New System.Drawing.Size(65, 20) + Me.tbMin.TabIndex = 13 + Me.tbMin.Text = "-20" + ' + 'graphs + ' + Me.graphs.Location = New System.Drawing.Point(64, 12) + Me.graphs.Name = "graphs" + Me.graphs.Size = New System.Drawing.Size(400, 250) + Me.graphs.TabIndex = 12 + Me.graphs.TabStop = False + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(529, 343) + Me.Controls.Add(Me.replot) + Me.Controls.Add(Me.label2) + Me.Controls.Add(Me.label1) + Me.Controls.Add(Me.tbMax) + Me.Controls.Add(Me.tbMin) + Me.Controls.Add(Me.graphs) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "97年工科技藝競賽第1題" + CType(Me.graphs, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Private WithEvents replot As System.Windows.Forms.Button + Private WithEvents label2 As System.Windows.Forms.Label + Private WithEvents label1 As System.Windows.Forms.Label + Private WithEvents tbMax As System.Windows.Forms.TextBox + Private WithEvents tbMin As System.Windows.Forms.TextBox + Private WithEvents graphs As System.Windows.Forms.PictureBox + +End Class diff --git a/97/97-1(VB.net)/97-1/Form1.resx b/97/97-1(VB.net)/97-1/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/97/97-1(VB.net)/97-1/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-1(VB.net)/97-1/Form1.vb b/97/97-1(VB.net)/97-1/Form1.vb new file mode 100644 index 0000000..5f48611 --- /dev/null +++ b/97/97-1(VB.net)/97-1/Form1.vb @@ -0,0 +1,53 @@ +Public Class Form1 + + Private Sub replot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles replot.Click + '建立新的點陣圖 + Dim Pict1 As New Bitmap(graphs.Width, graphs.Height) + Dim g As Graphics = Graphics.FromImage(Pict1) + '開始做畫 + Dim min, max As Single + Dim sMax As String = tbMax.Text + Dim sMin As String = tbMin.Text + max = Val(sMax) + min = Val(sMin) + If min >= max Or min < -30 Or max > 30 Then + inputError() + Exit Sub + End If + tbMax.Text = max + tbMin.Text = min + + Dim myPen As Pen = New Pen(Color.Black) + g.Clear(Color.White) '清成白色 + + '由pictureBox的長寬定義出放大變數 + Dim rateW As Single = graphs.Width / Math.Abs(min - max) + Dim rateH As Single = graphs.Height / 2.2F + Dim sw2 As Single = graphs.Width * Math.Abs(min) / Math.Abs(min - max) + Dim sh2 As Single = graphs.Height / 2.0F + If min > 0 And max > 0 Then sw2 *= -1 + + g.DrawLine(myPen, 0.0F, sh2, graphs.Width, sh2) + g.DrawLine(myPen, sw2, 0.0F, sw2, sh2 * 2) + myPen = New Pen(Color.Red) + Dim xx As Single = min + For x As Single = min To max Step 0.1F + + Dim yy As Single = Math.Sin(xx) / xx + Dim y As Single = Math.Sin(x) / x + If x = 0 Or xx = 0 Then + yy = 1 + y = 1 + End If + g.DrawLine(myPen, xx * rateW + sw2, -yy * rateH + sh2, x * rateW + sw2, -y * rateH + sh2) + xx = x + Next + '把畫好的點陣圖傳給 graphs(PictureBox) + graphs.Image = Pict1 + End Sub + Sub inputError() + tbMin.Text = "輸入錯誤" + tbMax.Text = "輸入錯誤" + End Sub + +End Class diff --git a/97/97-1(VB.net)/97-1/My Project/Application.Designer.vb b/97/97-1(VB.net)/97-1/My Project/Application.Designer.vb new file mode 100644 index 0000000..4a3cad5 --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_1.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-1(VB.net)/97-1/My Project/Application.myapp b/97/97-1(VB.net)/97-1/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/97/97-1(VB.net)/97-1/My Project/AssemblyInfo.vb b/97/97-1(VB.net)/97-1/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..30828ef --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-1(VB.net)/97-1/My Project/Resources.Designer.vb b/97/97-1(VB.net)/97-1/My Project/Resources.Designer.vb new file mode 100644 index 0000000..8fade63 --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_1.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-1(VB.net)/97-1/My Project/Resources.resx b/97/97-1(VB.net)/97-1/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-1(VB.net)/97-1/My Project/Settings.Designer.vb b/97/97-1(VB.net)/97-1/My Project/Settings.Designer.vb new file mode 100644 index 0000000..6dc35fe --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_1.My.MySettings + Get + Return Global._97_1.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-1(VB.net)/97-1/My Project/Settings.settings b/97/97-1(VB.net)/97-1/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-1(VB.net)/97-1/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/97/97-1(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" "b/97/97-1(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" new file mode 100644 index 0000000..ab20f5d --- /dev/null +++ "b/97/97-1(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2541\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第1題", "97-1\97年工科技藝競賽第1題.vbproj", "{159FB1EB-4D02-4447-AD0B-A630778F8490}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {159FB1EB-4D02-4447-AD0B-A630778F8490}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {159FB1EB-4D02-4447-AD0B-A630778F8490}.Debug|Any CPU.Build.0 = Debug|Any CPU + {159FB1EB-4D02-4447-AD0B-A630778F8490}.Release|Any CPU.ActiveCfg = Release|Any CPU + {159FB1EB-4D02-4447-AD0B-A630778F8490}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-2(VB.net)/2009-07-18_144356.png b/97/97-2(VB.net)/2009-07-18_144356.png new file mode 100644 index 0000000..dcdf028 Binary files /dev/null and b/97/97-2(VB.net)/2009-07-18_144356.png differ diff --git "a/97/97-2(VB.net)/97-2/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" "b/97/97-2(VB.net)/97-2/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" new file mode 100644 index 0000000..b47d562 --- /dev/null +++ "b/97/97-2(VB.net)/97-2/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6361E06F-0BEC-4BC9-8896-56D44A8E32C9} + WinExe + _97_2.My.MyApplication + _97_2 + 97-2 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-2.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-2(VB.net)/97-2/Form1.Designer.vb b/97/97-2(VB.net)/97-2/Form1.Designer.vb new file mode 100644 index 0000000..7159cdf --- /dev/null +++ b/97/97-2(VB.net)/97-2/Form1.Designer.vb @@ -0,0 +1,125 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.ISBN13 = New System.Windows.Forms.TextBox + Me.ISBN10 = New System.Windows.Forms.TextBox + Me.l2 = New System.Windows.Forms.Label + Me.l1 = New System.Windows.Forms.Label + Me.Button1 = New System.Windows.Forms.Button + Me.InputBox = New System.Windows.Forms.TextBox + Me.Label1 = New System.Windows.Forms.Label + Me.SuspendLayout() + ' + 'ISBN13 + ' + Me.ISBN13.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.ISBN13.Location = New System.Drawing.Point(97, 145) + Me.ISBN13.MaxLength = 17 + Me.ISBN13.Name = "ISBN13" + Me.ISBN13.Size = New System.Drawing.Size(164, 26) + Me.ISBN13.TabIndex = 13 + ' + 'ISBN10 + ' + Me.ISBN10.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.ISBN10.Location = New System.Drawing.Point(97, 119) + Me.ISBN10.MaxLength = 13 + Me.ISBN10.Name = "ISBN10" + Me.ISBN10.Size = New System.Drawing.Size(141, 26) + Me.ISBN10.TabIndex = 12 + ' + 'l2 + ' + Me.l2.AutoSize = True + Me.l2.Location = New System.Drawing.Point(38, 153) + Me.l2.Name = "l2" + Me.l2.Size = New System.Drawing.Size(50, 13) + Me.l2.TabIndex = 11 + Me.l2.Text = "ISBN-13:" + ' + 'l1 + ' + Me.l1.AutoSize = True + Me.l1.Location = New System.Drawing.Point(38, 127) + Me.l1.Name = "l1" + Me.l1.Size = New System.Drawing.Size(50, 13) + Me.l1.TabIndex = 10 + Me.l1.Text = "ISBN-10:" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(64, 57) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(197, 23) + Me.Button1.TabIndex = 9 + Me.Button1.Text = "計算ISBN檢查號" + Me.Button1.UseVisualStyleBackColor = True + ' + 'InputBox + ' + Me.InputBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(136, Byte)) + Me.InputBox.Location = New System.Drawing.Point(124, 17) + Me.InputBox.MaxLength = 13 + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(137, 26) + Me.InputBox.TabIndex = 8 + Me.InputBox.Text = "957857358" + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(21, 20) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(97, 13) + Me.Label1.TabIndex = 7 + Me.Label1.Text = "請輸入9位數數字" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(283, 188) + Me.Controls.Add(Me.ISBN13) + Me.Controls.Add(Me.ISBN10) + Me.Controls.Add(Me.l2) + Me.Controls.Add(Me.l1) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "97年工科技藝競賽第2題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents ISBN13 As System.Windows.Forms.TextBox + Friend WithEvents ISBN10 As System.Windows.Forms.TextBox + Friend WithEvents l2 As System.Windows.Forms.Label + Friend WithEvents l1 As System.Windows.Forms.Label + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents Label1 As System.Windows.Forms.Label + +End Class diff --git a/97/97-2(VB.net)/97-2/Form1.resx b/97/97-2(VB.net)/97-2/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/97/97-2(VB.net)/97-2/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-2(VB.net)/97-2/Form1.vb b/97/97-2(VB.net)/97-2/Form1.vb new file mode 100644 index 0000000..b95ffe7 --- /dev/null +++ b/97/97-2(VB.net)/97-2/Form1.vb @@ -0,0 +1,79 @@ +Public Class Form1 + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Dim tmp As String = Strings.Replace(InputBox.Text, "-", "") + If Len(tmp) <> 9 Then + ISBN10.Text = "輸入錯誤" + ISBN13.Text = "輸入錯誤" + Exit Sub + End If + For i As Integer = 1 To 9 + If IsNumeric(Mid(tmp, i, 1)) <> True Then + ISBN10.Text = "輸入錯誤" + ISBN13.Text = "輸入錯誤" + Exit Sub + End If + Next + ISBN10.Text = ToISBN10(tmp) + ISBN13.Text = ToISBN13(tmp) + End Sub + + Private Function Check(ByVal _s As String) As Boolean + Dim strs() = {"157", "204", "421", "442", "7198", "7323", "8573"} + For i = 0 To strs.Length - 1 + If _s = strs(i) Then Return True + Next + Return False + End Function + + Private Function CheckPublish(ByVal _isbn As String) As String + If Check(Mid(_isbn, 4, 4)) = True Then + Return Mid(_isbn, 1, 3) & "-" & Mid(_isbn, 4, 4) & "-" & Mid(_isbn, 8, 2) & "-" + Else + Return Mid(_isbn, 1, 3) & "-" & Mid(_isbn, 4, 3) & "-" & Mid(_isbn, 7, 3) & "-" + End If + End Function + + Private Function ToISBN10(ByVal _isbn As String) As String + Dim num(9) As Integer + Dim answer As String = CheckPublish(_isbn) + + For i As Integer = 1 To 9 + num(i) = Convert.ToInt16(Mid(_isbn, i, 1)) + Next + Dim sum As Long + For i As Integer = 1 To 9 + sum += num(i) * (11 - i) + Next + sum = sum Mod 11 + sum = 11 - sum + If sum = 10 Then + Return answer & "x" + ElseIf sum = 11 Then + Return answer & "0" + Else + Return answer & Convert.ToString(sum) + End If + End Function + Private Function ToISBN13(ByVal _isbn As String) As String + Dim num(9) As Integer + Dim answer As String = CheckPublish(_isbn) + + For i As Integer = 1 To 9 + num(i) = Convert.ToInt32(Mid(_isbn, i, 1)) + Next + Dim sum As Integer = 38 + For i As Integer = 1 To 9 + If i Mod 2 = 0 Then + sum += num(i) + Else + sum += num(i) * 3 + End If + Next + sum = sum Mod 10 + If sum = 0 Then + Return "978-" & answer & "0" + Else + Return "978-" & answer & Convert.ToString(10 - sum) + End If + End Function +End Class diff --git a/97/97-2(VB.net)/97-2/My Project/Application.Designer.vb b/97/97-2(VB.net)/97-2/My Project/Application.Designer.vb new file mode 100644 index 0000000..a98e83e --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_2.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-2(VB.net)/97-2/My Project/Application.myapp b/97/97-2(VB.net)/97-2/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/97/97-2(VB.net)/97-2/My Project/AssemblyInfo.vb b/97/97-2(VB.net)/97-2/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..3ea69b1 --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-2(VB.net)/97-2/My Project/Resources.Designer.vb b/97/97-2(VB.net)/97-2/My Project/Resources.Designer.vb new file mode 100644 index 0000000..6e4c31e --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_2.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-2(VB.net)/97-2/My Project/Resources.resx b/97/97-2(VB.net)/97-2/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-2(VB.net)/97-2/My Project/Settings.Designer.vb b/97/97-2(VB.net)/97-2/My Project/Settings.Designer.vb new file mode 100644 index 0000000..e2735ae --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_2.My.MySettings + Get + Return Global._97_2.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-2(VB.net)/97-2/My Project/Settings.settings b/97/97-2(VB.net)/97-2/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-2(VB.net)/97-2/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/97/97-2(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" "b/97/97-2(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" new file mode 100644 index 0000000..d5c54c7 --- /dev/null +++ "b/97/97-2(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2542\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第2題", "97-2\97年工科技藝競賽第2題.vbproj", "{6361E06F-0BEC-4BC9-8896-56D44A8E32C9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6361E06F-0BEC-4BC9-8896-56D44A8E32C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6361E06F-0BEC-4BC9-8896-56D44A8E32C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6361E06F-0BEC-4BC9-8896-56D44A8E32C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6361E06F-0BEC-4BC9-8896-56D44A8E32C9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-3(VB.net)/2009-07-18_144556.png b/97/97-3(VB.net)/2009-07-18_144556.png new file mode 100644 index 0000000..5346161 Binary files /dev/null and b/97/97-3(VB.net)/2009-07-18_144556.png differ diff --git "a/97/97-3(VB.net)/97-3/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" "b/97/97-3(VB.net)/97-3/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" new file mode 100644 index 0000000..99db971 --- /dev/null +++ "b/97/97-3(VB.net)/97-3/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {29466659-ABC2-4972-98D8-E0C66B79137E} + WinExe + _97_3.My.MyApplication + _97_3 + 97-3 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-3.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-3(VB.net)/97-3/Form1.Designer.vb b/97/97-3(VB.net)/97-3/Form1.Designer.vb new file mode 100644 index 0000000..edeb4cd --- /dev/null +++ b/97/97-3(VB.net)/97-3/Form1.Designer.vb @@ -0,0 +1,122 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.BtnConvert = New System.Windows.Forms.Button + Me.BtnExit = New System.Windows.Forms.Button + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Label3 = New System.Windows.Forms.Label + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.SuspendLayout() + ' + 'BtnConvert + ' + Me.BtnConvert.Location = New System.Drawing.Point(43, 129) + Me.BtnConvert.Name = "BtnConvert" + Me.BtnConvert.Size = New System.Drawing.Size(75, 23) + Me.BtnConvert.TabIndex = 0 + Me.BtnConvert.Text = "Convert" + Me.BtnConvert.UseVisualStyleBackColor = True + ' + 'BtnExit + ' + Me.BtnExit.Location = New System.Drawing.Point(168, 129) + Me.BtnExit.Name = "BtnExit" + Me.BtnExit.Size = New System.Drawing.Size(75, 23) + Me.BtnExit.TabIndex = 1 + Me.BtnExit.Text = "Exit" + Me.BtnExit.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(28, 63) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(70, 13) + Me.Label1.TabIndex = 2 + Me.Label1.Text = "Real number:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label2.Location = New System.Drawing.Point(39, 20) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(205, 20) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "Number System Conversion" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(28, 92) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(68, 13) + Me.Label3.TabIndex = 4 + Me.Label3.Text = "24-bit Binary:" + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(98, 60) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(131, 20) + Me.InputBox.TabIndex = 5 + Me.InputBox.Text = "-161.875" + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(98, 89) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(182, 20) + Me.OutputBox.TabIndex = 6 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(313, 168) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.BtnExit) + Me.Controls.Add(Me.BtnConvert) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "97年工科技藝競賽第3題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents BtnConvert As System.Windows.Forms.Button + Friend WithEvents BtnExit As System.Windows.Forms.Button + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + +End Class diff --git a/97/97-3(VB.net)/97-3/Form1.resx b/97/97-3(VB.net)/97-3/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/97/97-3(VB.net)/97-3/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-3(VB.net)/97-3/Form1.vb b/97/97-3(VB.net)/97-3/Form1.vb new file mode 100644 index 0000000..9667379 --- /dev/null +++ b/97/97-3(VB.net)/97-3/Form1.vb @@ -0,0 +1,52 @@ +Public Class Form1 + Private Sub BtnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnExit.Click + End + End Sub + + Private Sub BtnConvert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnConvert.Click + Dim Num As Double = Val(InputBox.Text) + If Math.Abs(Num) >= 65536 Then + OutputBox.Text = "overflow" + Exit Sub + End If + Dim sOut As String = "0" + If Num < 0 Then sOut = "1" + Num = Math.Abs(Num) + sOut += ToBin(Fix(Num)) & "." & DotToBin(Num - Fix(Num)) + OutputBox.Text = sOut + End Sub + Function ToBin(ByVal _Num As Long) As String + Dim sTmp As String = "" + While _Num > 0 + sTmp = Convert.ToString(_Num Mod 2) & sTmp + _Num \= 2 + End While + While Len(sTmp) < 15 + sTmp = "0" & sTmp + End While + If Len(sTmp) > 15 Then + sTmp = sTmp.Substring(1, 15) + End If + Return sTmp + End Function + Function DotToBin(ByVal _Num As Double) As String + Dim sTmp As String = "" + Dim i As Double = 0.5 + While _Num > 0 + If _Num >= i Then + _Num -= i + sTmp += "1" + Else + sTmp += "0" + End If + i /= 2 + End While + While Len(sTmp) < 8 + sTmp += "0" + End While + If Len(sTmp) > 8 Then + sTmp = sTmp.Substring(1, 8) + End If + Return sTmp + End Function +End Class diff --git a/97/97-3(VB.net)/97-3/My Project/Application.Designer.vb b/97/97-3(VB.net)/97-3/My Project/Application.Designer.vb new file mode 100644 index 0000000..36c1fee --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_3.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-3(VB.net)/97-3/My Project/Application.myapp b/97/97-3(VB.net)/97-3/My Project/Application.myapp new file mode 100644 index 0000000..2fd0d37 --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Application.myapp @@ -0,0 +1,10 @@ + + + true + Form1 + false + 0 + true + 0 + true + \ No newline at end of file diff --git a/97/97-3(VB.net)/97-3/My Project/AssemblyInfo.vb b/97/97-3(VB.net)/97-3/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..a407cee --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-3(VB.net)/97-3/My Project/Resources.Designer.vb b/97/97-3(VB.net)/97-3/My Project/Resources.Designer.vb new file mode 100644 index 0000000..aeea305 --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_3.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-3(VB.net)/97-3/My Project/Resources.resx b/97/97-3(VB.net)/97-3/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-3(VB.net)/97-3/My Project/Settings.Designer.vb b/97/97-3(VB.net)/97-3/My Project/Settings.Designer.vb new file mode 100644 index 0000000..98edf0b --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_3.My.MySettings + Get + Return Global._97_3.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-3(VB.net)/97-3/My Project/Settings.settings b/97/97-3(VB.net)/97-3/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-3(VB.net)/97-3/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/97/97-3(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" "b/97/97-3(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" new file mode 100644 index 0000000..39b9a2a --- /dev/null +++ "b/97/97-3(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2543\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第3題", "97-3\97年工科技藝競賽第3題.vbproj", "{29466659-ABC2-4972-98D8-E0C66B79137E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {29466659-ABC2-4972-98D8-E0C66B79137E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29466659-ABC2-4972-98D8-E0C66B79137E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29466659-ABC2-4972-98D8-E0C66B79137E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29466659-ABC2-4972-98D8-E0C66B79137E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-4(VB.net)/2009-07-18_144721.png b/97/97-4(VB.net)/2009-07-18_144721.png new file mode 100644 index 0000000..af56cf4 Binary files /dev/null and b/97/97-4(VB.net)/2009-07-18_144721.png differ diff --git "a/97/97-4(VB.net)/97-4/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" "b/97/97-4(VB.net)/97-4/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" new file mode 100644 index 0000000..962e020 --- /dev/null +++ "b/97/97-4(VB.net)/97-4/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {45EECB58-F9E6-46AB-9808-E10CD92A6D3A} + WinExe + _97_4.My.MyApplication + _97_4 + 97-4 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-4.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-4(VB.net)/97-4/Form1.Designer.vb b/97/97-4(VB.net)/97-4/Form1.Designer.vb new file mode 100644 index 0000000..76653e4 --- /dev/null +++ b/97/97-4(VB.net)/97-4/Form1.Designer.vb @@ -0,0 +1,128 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.Button2 = New System.Windows.Forms.Button + Me.Button1 = New System.Windows.Forms.Button + Me.InputBox = New System.Windows.Forms.TextBox + Me.RichTextBox = New System.Windows.Forms.RichTextBox + Me.OutputBox = New System.Windows.Forms.PictureBox + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 362) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(106, 13) + Me.Label1.TabIndex = 11 + Me.Label1.Text = "請輸入資料的總數:" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.BackColor = System.Drawing.SystemColors.ActiveBorder + Me.Label2.Location = New System.Drawing.Point(453, 26) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(146, 13) + Me.Label2.TabIndex = 8 + Me.Label2.Text = "線性回歸(Linear Regression)" & Global.Microsoft.VisualBasic.ChrW(10) + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(190, 381) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(104, 23) + Me.Button2.TabIndex = 10 + Me.Button2.Text = "清除所有資料" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(190, 352) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(104, 23) + Me.Button1.TabIndex = 9 + Me.Button1.Text = "確定" + Me.Button1.UseVisualStyleBackColor = True + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(18, 378) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(100, 20) + Me.InputBox.TabIndex = 7 + ' + 'RichTextBox + ' + Me.RichTextBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.RichTextBox.Location = New System.Drawing.Point(12, 12) + Me.RichTextBox.Name = "RichTextBox" + Me.RichTextBox.ReadOnly = True + Me.RichTextBox.Size = New System.Drawing.Size(301, 334) + Me.RichTextBox.TabIndex = 5 + Me.RichTextBox.Text = "線性回歸(Linear Regression)" & Global.Microsoft.VisualBasic.ChrW(10) & "利用最小平方方法讓一條直線來近一些點" + ' + 'OutputBox + ' + Me.OutputBox.BackColor = System.Drawing.SystemColors.ActiveBorder + Me.OutputBox.Location = New System.Drawing.Point(333, 13) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(400, 400) + Me.OutputBox.TabIndex = 6 + Me.OutputBox.TabStop = False + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.ClientSize = New System.Drawing.Size(747, 425) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.RichTextBox) + Me.Controls.Add(Me.OutputBox) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "97年工科技藝競賽第4題" + CType(Me.OutputBox, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents RichTextBox As System.Windows.Forms.RichTextBox + Friend WithEvents OutputBox As System.Windows.Forms.PictureBox + +End Class diff --git a/97/97-4(VB.net)/97-4/Form1.resx b/97/97-4(VB.net)/97-4/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/97/97-4(VB.net)/97-4/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-4(VB.net)/97-4/Form1.vb b/97/97-4(VB.net)/97-4/Form1.vb new file mode 100644 index 0000000..5fbdfad --- /dev/null +++ b/97/97-4(VB.net)/97-4/Form1.vb @@ -0,0 +1,107 @@ +Public Class Form1 + Dim str1 As String = "請輸入每一點資料的x,y [ x, y ]:" + Dim str2 As String = "請輸入資料的總數:" + Dim points(100) As PointF + Dim Count, NowCount As Integer + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + Try + If Label1.Text = str2 Then + Count = Convert.ToInt32(InputBox.Text) + Label1.Text = str1 + NowCount = 0 + RichTextBox.Text += vbCrLf + str2 + Str(Count) + ReSet() + Else + Dim StrTmp As String = InputBox.Text.Replace("[", "") + StrTmp = StrTmp.Replace("]", "") + Dim StrTmp2() As String = StrTmp.Split(" ") + points(NowCount).X = Val(StrTmp2(0)) + points(NowCount).Y = Val(StrTmp2(1)) + NowCount += 1 + RichTextBox.Text += vbCrLf + str1 + "[" + StrTmp2(0) + " " + StrTmp2(1) + "]" + ReSet() + Output() + End If + Catch ex As Exception + Exit Sub + End Try + If NowCount = Count And Count > 0 Then + Dim xy, xx, x, y, px, py, m, b As Double + For i = 0 To Count + xy += points(i).X * points(i).Y + xx += points(i).X * points(i).X + x += points(i).X + y += points(i).Y + Next + px = x / Count + py = y / Count + m = (xy - x * py) / (xx - x * px) + b = py - m * px + RichTextBox.Text += vbCrLf + "最小平方直線的回歸係數:" + RichTextBox.Text += vbCrLf + "斜率 (m) = " + Str(m) + RichTextBox.Text += vbCrLf + "截距 (b) = " + Str(b) + RichTextBox.Text += vbCrLf + "總資料點數= " + Str(Count) + ReSet() + Output() + Label1.Text = str2 + End If + InputBox.Text = "" + InputBox.Focus() + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + ReSet() + Label1.Text = str2 + RichTextBox.Text = "" + End Sub + Const XYstep As Integer = 40 + Private Sub ReSet() + '初始化畫畫工具 + Dim g As Graphics = OutputBox.CreateGraphics() + Dim MyPen As Pen = New Pen(Brushes.Black, 1.0F) + Dim MyBrush As Brush = Brushes.White + '畫出方形區 + g.FillRectangle(MyBrush, 50, 50, 320, 320) + g.DrawRectangle(MyPen, 50, 50, 320, 320) + MyPen.DashStyle = Drawing2D.DashStyle.Dash + '畫虛線 + For i As Integer = 50 To 50 + XYstep * 7 Step XYstep + g.DrawLine(MyPen, 50, i, 370, i) + g.DrawLine(MyPen, i, 50, i, 370) + Next + '畫數字1~8 + Dim Myfont As Font = New Font("新細明體", 12) + For i = 50 To 50 + XYstep * 8 Step XYstep + g.DrawString(Str(8 - (i - 50) / 40), Myfont, Brushes.Black, 30, i) + Next + For i = 70 To 70 + XYstep * 7 Step XYstep + g.DrawString(Str(1 + (i - 70) / 40), Myfont, Brushes.Black, i, 370) + Next + End Sub + + Private Sub Output() + '依座標畫線出來 + If NowCount > 0 Then + DrawLineToOutputBox(points(0).X, points(0).Y, points(0).X, points(0).Y) + End If + For i = 0 To NowCount - 2 + DrawLineToOutputBox(points(i).X, points(i).Y, points(i + 1).X, points(i + 1).Y) + Next + End Sub + Private Sub DrawLineToOutputBox(ByVal x1 As Single, ByVal y1 As Single, ByVal x2 As Single, ByVal y2 As Single) + Dim g As Graphics = OutputBox.CreateGraphics() + Dim MyPen As Pen = New Pen(Brushes.Red, 1.5F) + Dim MyPenB As Pen = New Pen(Brushes.Blue, 1.0F) + '把座標經過轉換後畫出來 + g.DrawArc(MyPenB, x2 * XYstep + 45, (8 - y2) * XYstep + 45, 10.0F, 10.0F, 0.0F, 360.0F) + g.DrawLine(MyPen, x1 * XYstep + 50, (8 - y1) * XYstep + 50, x2 * XYstep + 50, (8 - y2) * XYstep + 50) + End Sub + + Private Sub InputBox_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles InputBox.KeyDown + '按ENTER等於按確定 + If e.KeyData = Keys.Enter Then + Button1.PerformClick() + End If + End Sub +End Class diff --git a/97/97-4(VB.net)/97-4/My Project/Application.Designer.vb b/97/97-4(VB.net)/97-4/My Project/Application.Designer.vb new file mode 100644 index 0000000..a19e9c2 --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_4.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-4(VB.net)/97-4/My Project/Application.myapp b/97/97-4(VB.net)/97-4/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/97/97-4(VB.net)/97-4/My Project/AssemblyInfo.vb b/97/97-4(VB.net)/97-4/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..3a40a66 --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-4(VB.net)/97-4/My Project/Resources.Designer.vb b/97/97-4(VB.net)/97-4/My Project/Resources.Designer.vb new file mode 100644 index 0000000..60f9d25 --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_4.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-4(VB.net)/97-4/My Project/Resources.resx b/97/97-4(VB.net)/97-4/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-4(VB.net)/97-4/My Project/Settings.Designer.vb b/97/97-4(VB.net)/97-4/My Project/Settings.Designer.vb new file mode 100644 index 0000000..99996fe --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_4.My.MySettings + Get + Return Global._97_4.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-4(VB.net)/97-4/My Project/Settings.settings b/97/97-4(VB.net)/97-4/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-4(VB.net)/97-4/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/97/97-4(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" "b/97/97-4(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" new file mode 100644 index 0000000..161a8fe --- /dev/null +++ "b/97/97-4(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2544\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第4題", "97-4\97年工科技藝競賽第4題.vbproj", "{45EECB58-F9E6-46AB-9808-E10CD92A6D3A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {45EECB58-F9E6-46AB-9808-E10CD92A6D3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45EECB58-F9E6-46AB-9808-E10CD92A6D3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45EECB58-F9E6-46AB-9808-E10CD92A6D3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45EECB58-F9E6-46AB-9808-E10CD92A6D3A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-5(VB.net)/2009-07-18_144757.png b/97/97-5(VB.net)/2009-07-18_144757.png new file mode 100644 index 0000000..95b6ab5 Binary files /dev/null and b/97/97-5(VB.net)/2009-07-18_144757.png differ diff --git "a/97/97-5(VB.net)/97-5/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" "b/97/97-5(VB.net)/97-5/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" new file mode 100644 index 0000000..dd19446 --- /dev/null +++ "b/97/97-5(VB.net)/97-5/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.vbproj" @@ -0,0 +1,122 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {02EA6AB3-47FF-42F1-BD9C-5AC25028F679} + WinExe + _97_5.My.MyApplication + _97_5 + 97-5 + 512 + WindowsForms + v3.5 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-5.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + 3.5 + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-5(VB.net)/97-5/Form1.Designer.vb b/97/97-5(VB.net)/97-5/Form1.Designer.vb new file mode 100644 index 0000000..a3ff81c --- /dev/null +++ b/97/97-5(VB.net)/97-5/Form1.Designer.vb @@ -0,0 +1,174 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label + Me.Label2 = New System.Windows.Forms.Label + Me.InputBox = New System.Windows.Forms.TextBox + Me.OutputBox = New System.Windows.Forms.TextBox + Me.InputBoxD = New System.Windows.Forms.TextBox + Me.InputBoxK = New System.Windows.Forms.TextBox + Me.Label3 = New System.Windows.Forms.Label + Me.Label4 = New System.Windows.Forms.Label + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.Button3 = New System.Windows.Forms.Button + Me.OpenFileDialog = New System.Windows.Forms.OpenFileDialog + Me.SaveFileDialog = New System.Windows.Forms.SaveFileDialog + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(27, 31) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(103, 13) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "輸入檔案路徑名稱" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(27, 59) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(103, 13) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "輸出檔案路徑名稱" + ' + 'InputBox + ' + Me.InputBox.Location = New System.Drawing.Point(136, 28) + Me.InputBox.Name = "InputBox" + Me.InputBox.Size = New System.Drawing.Size(100, 20) + Me.InputBox.TabIndex = 2 + ' + 'OutputBox + ' + Me.OutputBox.Location = New System.Drawing.Point(136, 56) + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.Size = New System.Drawing.Size(100, 20) + Me.OutputBox.TabIndex = 3 + ' + 'InputBoxD + ' + Me.InputBoxD.Location = New System.Drawing.Point(321, 56) + Me.InputBoxD.Name = "InputBoxD" + Me.InputBoxD.Size = New System.Drawing.Size(100, 20) + Me.InputBoxD.TabIndex = 7 + Me.InputBoxD.Text = "69.64" + ' + 'InputBoxK + ' + Me.InputBoxK.Location = New System.Drawing.Point(321, 28) + Me.InputBoxK.Name = "InputBoxK" + Me.InputBoxK.Size = New System.Drawing.Size(100, 20) + Me.InputBoxK.TabIndex = 6 + Me.InputBoxK.Text = "68.12" + ' + 'Label3 + ' + Me.Label3.AutoSize = True + Me.Label3.Location = New System.Drawing.Point(259, 59) + Me.Label3.Name = "Label3" + Me.Label3.Size = New System.Drawing.Size(57, 13) + Me.Label3.TabIndex = 5 + Me.Label3.Text = "第8日D值" + ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(259, 31) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(56, 13) + Me.Label4.TabIndex = 4 + Me.Label4.Text = "第8日K值" + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(136, 92) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 8 + Me.Button1.Text = "執行" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(236, 92) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 9 + Me.Button2.Text = "驗證" + Me.Button2.UseVisualStyleBackColor = True + ' + 'Button3 + ' + Me.Button3.Location = New System.Drawing.Point(136, 121) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(75, 23) + Me.Button3.TabIndex = 10 + Me.Button3.Text = "結束" + Me.Button3.UseVisualStyleBackColor = True + ' + 'OpenFileDialog + ' + Me.OpenFileDialog.FileName = "OpenFileDialog1" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(444, 161) + Me.Controls.Add(Me.Button3) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.InputBoxD) + Me.Controls.Add(Me.InputBoxK) + Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label4) + Me.Controls.Add(Me.OutputBox) + Me.Controls.Add(Me.InputBox) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "97年工科技藝競賽第5題" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents InputBox As System.Windows.Forms.TextBox + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + Friend WithEvents InputBoxD As System.Windows.Forms.TextBox + Friend WithEvents InputBoxK As System.Windows.Forms.TextBox + Friend WithEvents Label3 As System.Windows.Forms.Label + Friend WithEvents Label4 As System.Windows.Forms.Label + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + Friend WithEvents Button3 As System.Windows.Forms.Button + Friend WithEvents OpenFileDialog As System.Windows.Forms.OpenFileDialog + Friend WithEvents SaveFileDialog As System.Windows.Forms.SaveFileDialog + +End Class diff --git a/97/97-5(VB.net)/97-5/Form1.resx b/97/97-5(VB.net)/97-5/Form1.resx new file mode 100644 index 0000000..74bfba5 --- /dev/null +++ b/97/97-5(VB.net)/97-5/Form1.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 152, 17 + + \ No newline at end of file diff --git a/97/97-5(VB.net)/97-5/Form1.vb b/97/97-5(VB.net)/97-5/Form1.vb new file mode 100644 index 0000000..c848695 --- /dev/null +++ b/97/97-5(VB.net)/97-5/Form1.vb @@ -0,0 +1,146 @@ +' 匯入命名空間 +Imports System.IO +Public Class Form1 + Dim MaxValues(100), MinValues(100), OverValues(100), KValues(100), DValues(100) As Single + + Private Sub InputBox_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles InputBox.MouseDoubleClick + OpenFileDialog.ShowDialog() + InputBox.Text = OpenFileDialog.FileName + End Sub + + Private Sub OutputBox_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles OutputBox.MouseDoubleClick + SaveFileDialog.ShowDialog() + OutputBox.Text = SaveFileDialog.FileName + End Sub + + Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click + If InputBoxD.Text <> "" And InputBoxK.Text <> "" And InputBox.Text <> "" And OutputBox.Text <> "" Then + Dim Count As Integer = 0 + Try + Using myStreamReader As StreamReader = File.OpenText(InputBox.Text) + Dim myInputString As String + Dim rowCount As Integer = 0 + While True + myInputString = myStreamReader.ReadLine() + If myInputString Is Nothing Then + Exit While + End If + Dim strTmp() As String = myInputString.Split(" ") + Count += 1 + MaxValues(Count) = Val(strTmp(1)) + MinValues(Count) = Val(strTmp(2)) + OverValues(Count) = Val(strTmp(3)) + End While + End Using + Catch ex As Exception + MessageBox.Show("檔案讀取錯誤。" + Environment.NewLine + "例外狀況:" + ex.Message) + End Try + Using myStreamWriter As StreamWriter = File.CreateText(OutputBox.Text) + For i = 0 To 7 + myStreamWriter.WriteLine(Str(i)) + Next + myStreamWriter.WriteLine(" 8 " & InputBoxK.Text & " " & InputBoxD.Text) + Dim NowK As Single = Val(InputBoxK.Text) + Dim NowD As Single = Val(InputBoxD.Text) + For DayCount = 9 To Count + Dim minPrice, maxPrice As Single + minPrice = MinValues(DayCount) + maxPrice = MaxValues(DayCount) + For RSV_Count = DayCount To DayCount - 8 Step -1 + If minPrice > MinValues(RSV_Count) Then + minPrice = MinValues(RSV_Count) + End If + If maxPrice < MaxValues(RSV_Count) Then + maxPrice = MaxValues(RSV_Count) + End If + Next + Dim RSV As Single = (OverValues(DayCount) - minPrice) / (maxPrice - minPrice) * 100 + NowK = NowK * 2 / 3 + RSV / 3 + NowD = NowD * 2 / 3 + NowK / 3 + myStreamWriter.WriteLine(Str(DayCount) & Format(NowK, " 00.00 ") & Format(NowD, "00.00")) + Next + End Using + End If + End Sub + + Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click + If InputBoxD.Text <> "" And InputBoxK.Text <> "" And InputBox.Text <> "" And OutputBox.Text <> "" Then + Dim Count As Integer = 0 + Try + Using myStreamReader As StreamReader = File.OpenText(InputBox.Text) + Dim myInputString As String + Dim rowCount As Integer = 0 + While True + myInputString = myStreamReader.ReadLine() + If myInputString Is Nothing Then + Exit While + End If + Dim strTmp() As String = myInputString.Split(" ") + Count += 1 + MaxValues(Count) = Val(strTmp(1)) + MinValues(Count) = Val(strTmp(2)) + OverValues(Count) = Val(strTmp(3)) + End While + End Using + Catch ex As Exception + MessageBox.Show("檔案讀取錯誤。" + Environment.NewLine + "例外狀況:" + ex.Message) + End Try + '算出KD來 + Dim NowK As Single = Val(InputBoxK.Text) + Dim NowD As Single = Val(InputBoxD.Text) + KValues(8) = NowK + DValues(8) = NowD + For DayCount = 9 To Count + Dim minPrice, maxPrice As Single + minPrice = MinValues(DayCount) + maxPrice = MaxValues(DayCount) + For RSV_Count = DayCount To DayCount - 8 Step -1 + If minPrice > MinValues(RSV_Count) Then + minPrice = MinValues(RSV_Count) + End If + If maxPrice < MaxValues(RSV_Count) Then + maxPrice = MaxValues(RSV_Count) + End If + Next + Dim RSV As Single = (OverValues(DayCount) - minPrice) / (maxPrice - minPrice) * 100 + NowK = NowK * 2 / 3 + RSV / 3 + NowD = NowD * 2 / 3 + NowK / 3 + KValues(DayCount) = Val(Format(NowK, " 00.00 ")) + DValues(DayCount) = Val(Format(NowD, "00.00")) + Next + + Try + Using myStreamReader As StreamReader = File.OpenText(OutputBox.Text) + Dim myInputString As String + For i = 0 To 7 + myStreamReader.ReadLine() + Next + Dim rowCount As Integer = 7 + While True + myInputString = myStreamReader.ReadLine() + If myInputString Is Nothing Then + Exit While + End If + Dim strTmp() As String = myInputString.Split(" ") + rowCount += 1 + + If KValues(rowCount) <> Convert.ToSingle(strTmp(2)) Or _ + DValues(rowCount) <> Convert.ToSingle(strTmp(3)) Then + MessageBox.Show("驗證失敗") + Exit Sub + End If + End While + End Using + MessageBox.Show("驗證成功") + Catch ex As Exception + MessageBox.Show("驗證失敗") + End Try + End If + End Sub + + Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click + End + End Sub + + +End Class diff --git a/97/97-5(VB.net)/97-5/My Project/Application.Designer.vb b/97/97-5(VB.net)/97-5/My Project/Application.Designer.vb new file mode 100644 index 0000000..0b01e36 --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_5.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-5(VB.net)/97-5/My Project/Application.myapp b/97/97-5(VB.net)/97-5/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/97/97-5(VB.net)/97-5/My Project/AssemblyInfo.vb b/97/97-5(VB.net)/97-5/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..8d38000 --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-5(VB.net)/97-5/My Project/Resources.Designer.vb b/97/97-5(VB.net)/97-5/My Project/Resources.Designer.vb new file mode 100644 index 0000000..4a63ecf --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_5.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-5(VB.net)/97-5/My Project/Resources.resx b/97/97-5(VB.net)/97-5/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-5(VB.net)/97-5/My Project/Settings.Designer.vb b/97/97-5(VB.net)/97-5/My Project/Settings.Designer.vb new file mode 100644 index 0000000..e9ae4da --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_5.My.MySettings + Get + Return Global._97_5.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-5(VB.net)/97-5/My Project/Settings.settings b/97/97-5(VB.net)/97-5/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-5(VB.net)/97-5/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/97/97-5(VB.net)/97-5/inp.txt b/97/97-5(VB.net)/97-5/inp.txt new file mode 100644 index 0000000..e78e5f9 --- /dev/null +++ b/97/97-5(VB.net)/97-5/inp.txt @@ -0,0 +1,12 @@ +1 42.45 44.90 42.00 +2 44.90 43.25 44.90 +3 48.00 45.10 48.00 +4 49.50 46.00 47.00 +5 48.50 46.70 48.00 +6 49.40 47.25 48.00 +7 44.70 44.65 44.65 +8 44.65 41.55 43.50 +9 43.40 41.90 43.20 +10 44.00 42.00 43.10 +11 44.15 42.65 43.40 +12 41.65 40.50 40.50 \ No newline at end of file diff --git a/97/97-5(VB.net)/97-5/inp2.txt b/97/97-5(VB.net)/97-5/inp2.txt new file mode 100644 index 0000000..693a177 --- /dev/null +++ b/97/97-5(VB.net)/97-5/inp2.txt @@ -0,0 +1,12 @@ +1 42.45 44.90 42.00 +2 44.90 43.25 44.90 +3 52.00 46.10 48.00 +4 50.50 47.00 47.00 +5 48.50 46.70 48.00 +6 49.40 47.25 48.00 +7 44.70 44.65 44.65 +8 44.65 41.55 43.50 +9 43.40 41.90 43.20 +10 44.00 42.00 43.10 +11 44.15 42.65 43.40 +12 41.65 40.50 40.50 \ No newline at end of file diff --git a/97/97-5(VB.net)/97-5/out.txt b/97/97-5(VB.net)/97-5/out.txt new file mode 100644 index 0000000..23bf40b --- /dev/null +++ b/97/97-5(VB.net)/97-5/out.txt @@ -0,0 +1,13 @@ + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 68.12 69.64 + 9 52.33 63.87 + 10 41.39 56.38 + 11 35.35 49.37 + 12 23.57 40.77 diff --git "a/97/97-5(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" "b/97/97-5(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" new file mode 100644 index 0000000..3ee705e --- /dev/null +++ "b/97/97-5(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2545\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第5題", "97-5\97年工科技藝競賽第5題.vbproj", "{02EA6AB3-47FF-42F1-BD9C-5AC25028F679}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {02EA6AB3-47FF-42F1-BD9C-5AC25028F679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {02EA6AB3-47FF-42F1-BD9C-5AC25028F679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {02EA6AB3-47FF-42F1-BD9C-5AC25028F679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {02EA6AB3-47FF-42F1-BD9C-5AC25028F679}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/97/97-6(VB.net)/2009-07-18_144901.png b/97/97-6(VB.net)/2009-07-18_144901.png new file mode 100644 index 0000000..02c76c4 Binary files /dev/null and b/97/97-6(VB.net)/2009-07-18_144901.png differ diff --git "a/97/97-6(VB.net)/97-6/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" "b/97/97-6(VB.net)/97-6/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" new file mode 100644 index 0000000..3e2a2ad --- /dev/null +++ "b/97/97-6(VB.net)/97-6/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.vbproj" @@ -0,0 +1,111 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E} + WinExe + _97_6.My.MyApplication + _97_6 + 97-6 + 512 + WindowsForms + v2.0 + On + Binary + Off + On + + + true + full + true + true + bin\Debug\ + 97-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + pdbonly + false + true + true + bin\Release\ + 97-6.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/97/97-6(VB.net)/97-6/Form1.Designer.vb b/97/97-6(VB.net)/97-6/Form1.Designer.vb new file mode 100644 index 0000000..77dddd8 --- /dev/null +++ b/97/97-6(VB.net)/97-6/Form1.Designer.vb @@ -0,0 +1,283 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form 覆寫 Dispose 以清除元件清單。 + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + '為 Windows Form 設計工具的必要項 + Private components As System.ComponentModel.IContainer + + '注意: 以下為 Windows Form 設計工具所需的程序 + '可以使用 Windows Form 設計工具進行修改。 + '請不要使用程式碼編輯器進行修改。 + _ + Private Sub InitializeComponent() + Me.OutputBox = New System.Windows.Forms.TextBox + Me.Btn7 = New System.Windows.Forms.Button + Me.Btn4 = New System.Windows.Forms.Button + Me.Btn1 = New System.Windows.Forms.Button + Me.Btnpm = New System.Windows.Forms.Button + Me.Btn0 = New System.Windows.Forms.Button + Me.Btn2 = New System.Windows.Forms.Button + Me.Btn5 = New System.Windows.Forms.Button + Me.Btn8 = New System.Windows.Forms.Button + Me.BtnDot = New System.Windows.Forms.Button + Me.Btn3 = New System.Windows.Forms.Button + Me.Btn6 = New System.Windows.Forms.Button + Me.Btn9 = New System.Windows.Forms.Button + Me.BtnEqu = New System.Windows.Forms.Button + Me.BtnNat = New System.Windows.Forms.Button + Me.BtnPlus = New System.Windows.Forms.Button + Me.BtnLog = New System.Windows.Forms.Button + Me.BtnDiv = New System.Windows.Forms.Button + Me.BtnTimes = New System.Windows.Forms.Button + Me.BtnAC = New System.Windows.Forms.Button + Me.SuspendLayout() + ' + 'OutputBox + ' + Me.OutputBox.BackColor = System.Drawing.SystemColors.ActiveCaptionText + Me.OutputBox.Location = New System.Drawing.Point(29, 19) + Me.OutputBox.MaxLength = 20 + Me.OutputBox.Name = "OutputBox" + Me.OutputBox.ReadOnly = True + Me.OutputBox.RightToLeft = System.Windows.Forms.RightToLeft.No + Me.OutputBox.Size = New System.Drawing.Size(271, 20) + Me.OutputBox.TabIndex = 0 + Me.OutputBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Right + ' + 'Btn7 + ' + Me.Btn7.Location = New System.Drawing.Point(29, 54) + Me.Btn7.Name = "Btn7" + Me.Btn7.Size = New System.Drawing.Size(39, 34) + Me.Btn7.TabIndex = 1 + Me.Btn7.Text = "7" + Me.Btn7.UseVisualStyleBackColor = True + ' + 'Btn4 + ' + Me.Btn4.Location = New System.Drawing.Point(29, 100) + Me.Btn4.Name = "Btn4" + Me.Btn4.Size = New System.Drawing.Size(39, 34) + Me.Btn4.TabIndex = 2 + Me.Btn4.Text = "4" + Me.Btn4.UseVisualStyleBackColor = True + ' + 'Btn1 + ' + Me.Btn1.Location = New System.Drawing.Point(29, 146) + Me.Btn1.Name = "Btn1" + Me.Btn1.Size = New System.Drawing.Size(39, 34) + Me.Btn1.TabIndex = 3 + Me.Btn1.Text = "1" + Me.Btn1.UseVisualStyleBackColor = True + ' + 'Btnpm + ' + Me.Btnpm.Location = New System.Drawing.Point(29, 192) + Me.Btnpm.Name = "Btnpm" + Me.Btnpm.Size = New System.Drawing.Size(39, 34) + Me.Btnpm.TabIndex = 4 + Me.Btnpm.Text = "+/-" + Me.Btnpm.UseVisualStyleBackColor = True + ' + 'Btn0 + ' + Me.Btn0.Location = New System.Drawing.Point(87, 192) + Me.Btn0.Name = "Btn0" + Me.Btn0.Size = New System.Drawing.Size(39, 34) + Me.Btn0.TabIndex = 8 + Me.Btn0.Text = "0" + Me.Btn0.UseVisualStyleBackColor = True + ' + 'Btn2 + ' + Me.Btn2.Location = New System.Drawing.Point(87, 146) + Me.Btn2.Name = "Btn2" + Me.Btn2.Size = New System.Drawing.Size(39, 34) + Me.Btn2.TabIndex = 7 + Me.Btn2.Text = "2" + Me.Btn2.UseVisualStyleBackColor = True + ' + 'Btn5 + ' + Me.Btn5.Location = New System.Drawing.Point(87, 100) + Me.Btn5.Name = "Btn5" + Me.Btn5.Size = New System.Drawing.Size(39, 34) + Me.Btn5.TabIndex = 6 + Me.Btn5.Text = "5" + Me.Btn5.UseVisualStyleBackColor = True + ' + 'Btn8 + ' + Me.Btn8.Location = New System.Drawing.Point(87, 54) + Me.Btn8.Name = "Btn8" + Me.Btn8.Size = New System.Drawing.Size(39, 34) + Me.Btn8.TabIndex = 5 + Me.Btn8.Text = "8" + Me.Btn8.UseVisualStyleBackColor = True + ' + 'BtnDot + ' + Me.BtnDot.Location = New System.Drawing.Point(145, 192) + Me.BtnDot.Name = "BtnDot" + Me.BtnDot.Size = New System.Drawing.Size(39, 34) + Me.BtnDot.TabIndex = 12 + Me.BtnDot.Text = "." + Me.BtnDot.UseVisualStyleBackColor = True + ' + 'Btn3 + ' + Me.Btn3.Location = New System.Drawing.Point(145, 146) + Me.Btn3.Name = "Btn3" + Me.Btn3.Size = New System.Drawing.Size(39, 34) + Me.Btn3.TabIndex = 11 + Me.Btn3.Text = "3" + Me.Btn3.UseVisualStyleBackColor = True + ' + 'Btn6 + ' + Me.Btn6.Location = New System.Drawing.Point(145, 100) + Me.Btn6.Name = "Btn6" + Me.Btn6.Size = New System.Drawing.Size(39, 34) + Me.Btn6.TabIndex = 10 + Me.Btn6.Text = "6" + Me.Btn6.UseVisualStyleBackColor = True + ' + 'Btn9 + ' + Me.Btn9.Location = New System.Drawing.Point(145, 54) + Me.Btn9.Name = "Btn9" + Me.Btn9.Size = New System.Drawing.Size(39, 34) + Me.Btn9.TabIndex = 9 + Me.Btn9.Text = "9" + Me.Btn9.UseVisualStyleBackColor = True + ' + 'BtnEqu + ' + Me.BtnEqu.Location = New System.Drawing.Point(203, 192) + Me.BtnEqu.Name = "BtnEqu" + Me.BtnEqu.Size = New System.Drawing.Size(97, 34) + Me.BtnEqu.TabIndex = 16 + Me.BtnEqu.Text = "=" + Me.BtnEqu.UseVisualStyleBackColor = True + ' + 'BtnNat + ' + Me.BtnNat.Location = New System.Drawing.Point(203, 146) + Me.BtnNat.Name = "BtnNat" + Me.BtnNat.Size = New System.Drawing.Size(39, 34) + Me.BtnNat.TabIndex = 15 + Me.BtnNat.Text = "-" + Me.BtnNat.UseVisualStyleBackColor = True + ' + 'BtnPlus + ' + Me.BtnPlus.Location = New System.Drawing.Point(203, 100) + Me.BtnPlus.Name = "BtnPlus" + Me.BtnPlus.Size = New System.Drawing.Size(39, 34) + Me.BtnPlus.TabIndex = 14 + Me.BtnPlus.Text = "+" + Me.BtnPlus.UseVisualStyleBackColor = True + ' + 'BtnLog + ' + Me.BtnLog.Location = New System.Drawing.Point(203, 54) + Me.BtnLog.Name = "BtnLog" + Me.BtnLog.Size = New System.Drawing.Size(39, 34) + Me.BtnLog.TabIndex = 13 + Me.BtnLog.Text = "Log" + Me.BtnLog.UseVisualStyleBackColor = True + ' + 'BtnDiv + ' + Me.BtnDiv.Location = New System.Drawing.Point(261, 146) + Me.BtnDiv.Name = "BtnDiv" + Me.BtnDiv.Size = New System.Drawing.Size(39, 34) + Me.BtnDiv.TabIndex = 19 + Me.BtnDiv.Text = "/" + Me.BtnDiv.UseVisualStyleBackColor = True + ' + 'BtnTimes + ' + Me.BtnTimes.Location = New System.Drawing.Point(261, 100) + Me.BtnTimes.Name = "BtnTimes" + Me.BtnTimes.Size = New System.Drawing.Size(39, 34) + Me.BtnTimes.TabIndex = 18 + Me.BtnTimes.Text = "x" + Me.BtnTimes.UseVisualStyleBackColor = True + ' + 'BtnAC + ' + Me.BtnAC.Location = New System.Drawing.Point(261, 54) + Me.BtnAC.Name = "BtnAC" + Me.BtnAC.Size = New System.Drawing.Size(39, 34) + Me.BtnAC.TabIndex = 17 + Me.BtnAC.Text = "AC" + Me.BtnAC.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(328, 239) + Me.Controls.Add(Me.BtnDiv) + Me.Controls.Add(Me.BtnTimes) + Me.Controls.Add(Me.BtnAC) + Me.Controls.Add(Me.BtnEqu) + Me.Controls.Add(Me.BtnNat) + Me.Controls.Add(Me.BtnPlus) + Me.Controls.Add(Me.BtnLog) + Me.Controls.Add(Me.BtnDot) + Me.Controls.Add(Me.Btn3) + Me.Controls.Add(Me.Btn6) + Me.Controls.Add(Me.Btn9) + Me.Controls.Add(Me.Btn0) + Me.Controls.Add(Me.Btn2) + Me.Controls.Add(Me.Btn5) + Me.Controls.Add(Me.Btn8) + Me.Controls.Add(Me.Btnpm) + Me.Controls.Add(Me.Btn1) + Me.Controls.Add(Me.Btn4) + Me.Controls.Add(Me.Btn7) + Me.Controls.Add(Me.OutputBox) + Me.Name = "Form1" + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "簡易計算機" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents OutputBox As System.Windows.Forms.TextBox + Friend WithEvents Btn7 As System.Windows.Forms.Button + Friend WithEvents Btn4 As System.Windows.Forms.Button + Friend WithEvents Btn1 As System.Windows.Forms.Button + Friend WithEvents Btnpm As System.Windows.Forms.Button + Friend WithEvents Btn0 As System.Windows.Forms.Button + Friend WithEvents Btn2 As System.Windows.Forms.Button + Friend WithEvents Btn5 As System.Windows.Forms.Button + Friend WithEvents Btn8 As System.Windows.Forms.Button + Friend WithEvents BtnDot As System.Windows.Forms.Button + Friend WithEvents Btn3 As System.Windows.Forms.Button + Friend WithEvents Btn6 As System.Windows.Forms.Button + Friend WithEvents Btn9 As System.Windows.Forms.Button + Friend WithEvents BtnEqu As System.Windows.Forms.Button + Friend WithEvents BtnNat As System.Windows.Forms.Button + Friend WithEvents BtnPlus As System.Windows.Forms.Button + Friend WithEvents BtnLog As System.Windows.Forms.Button + Friend WithEvents BtnDiv As System.Windows.Forms.Button + Friend WithEvents BtnTimes As System.Windows.Forms.Button + Friend WithEvents BtnAC As System.Windows.Forms.Button + +End Class diff --git a/97/97-6(VB.net)/97-6/Form1.resx b/97/97-6(VB.net)/97-6/Form1.resx new file mode 100644 index 0000000..19dc0dd --- /dev/null +++ b/97/97-6(VB.net)/97-6/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-6(VB.net)/97-6/Form1.vb b/97/97-6(VB.net)/97-6/Form1.vb new file mode 100644 index 0000000..51a6a3b --- /dev/null +++ b/97/97-6(VB.net)/97-6/Form1.vb @@ -0,0 +1,143 @@ +Public Class Form1 + Dim Tsum As Decimal = 0 + Dim Sum As Decimal = 0 + Dim isDot As Boolean = False + Dim dotNum As Decimal = 0 + Dim Flag As String = "" + Dim isReset As Boolean = False + Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load + OutputBox.Text = "0" + End Sub + + Private Sub Btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click + HandleNum(1) + End Sub + + Private Sub Btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn2.Click + HandleNum(2) + End Sub + + Private Sub Btn3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn3.Click + HandleNum(3) + End Sub + + Private Sub Btn4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn4.Click + HandleNum(4) + End Sub + + Private Sub Btn5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn5.Click + HandleNum(5) + End Sub + + Private Sub Btn6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn6.Click + HandleNum(6) + End Sub + + Private Sub Btn7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn7.Click + HandleNum(7) + End Sub + + Private Sub Btn8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn8.Click + HandleNum(8) + End Sub + + Private Sub Btn9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn9.Click + HandleNum(9) + End Sub + Private Sub Btn0_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn0.Click + If isReset Then + BtnAC.PerformClick() + isReset = False + End If + If isDot Then + dotNum += 1 + OutputBox.Text += "0" + Else + Sum = Sum * 10 + OutputBox.Text = Str(Sum) + End If + End Sub + Private Sub HandleNum(ByVal _num As Decimal) + If isReset Then + BtnAC.PerformClick() + isReset = False + End If + If isDot Then + dotNum += 1 + Sum += (10 ^ (-dotNum)) * _num + Else + Sum = Sum * 10 + _num + End If + OutputBox.Text = Str(Sum) + If Sum < 1 And Sum > 0 Then + OutputBox.Text = "0" & OutputBox.Text + End If + End Sub + + Private Sub BtnDot_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDot.Click + isDot = True + If Sum = Math.Floor(Sum) Then + OutputBox.Text = Str(Sum) + "." + End If + End Sub + + Private Sub BtnAC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnAC.Click + Sum = 0 + Tsum = 0 + dotNum = 0 + isDot = False + Flag = "" + OutputBox.Text = "0" + End Sub + + Private Sub BtnEqu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEqu.Click + Select Case Flag + Case "+" + Sum += Tsum + Case "-" + Sum = Tsum - Sum + Case "x" + Sum *= Tsum + Case "/" + Sum = Tsum / Sum + End Select + OutputBox.Text = Str(Sum) + isReset = True + If Sum < 1 And Sum > 0 Then + OutputBox.Text = "0" & OutputBox.Text + End If + End Sub + Private Sub HandleFlag(ByVal _f As String) + Flag = _f + Tsum = Sum + Sum = 0 + dotNum = 0 + isDot = False + OutputBox.Text = "0" + End Sub + Private Sub BtnPlus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPlus.Click + HandleFlag("+") + End Sub + + Private Sub BtnNat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnNat.Click + HandleFlag("-") + End Sub + + Private Sub BtnTimes_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTimes.Click + HandleFlag("x") + End Sub + + Private Sub BtnDiv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnDiv.Click + HandleFlag("/") + End Sub + + Private Sub BtnLog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLog.Click + If Sum = 0 Then Exit Sub + isReset = True + Sum = Math.Log10(Sum) + OutputBox.Text = Str(Sum) + If Sum < 1 And Sum > 0 Then + OutputBox.Text = "0" & OutputBox.Text + End If + End Sub +End Class diff --git a/97/97-6(VB.net)/97-6/My Project/Application.Designer.vb b/97/97-6(VB.net)/97-6/My Project/Application.Designer.vb new file mode 100644 index 0000000..e25e332 --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global._97_6.Form1 + End Sub + End Class +End Namespace diff --git a/97/97-6(VB.net)/97-6/My Project/Application.myapp b/97/97-6(VB.net)/97-6/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/97/97-6(VB.net)/97-6/My Project/AssemblyInfo.vb b/97/97-6(VB.net)/97-6/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..a05f312 --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 組件的一般資訊是由下列的屬性集控制。 +' 變更這些屬性的值即可修改組件的相關 +' 資訊。 + +' 檢閱組件屬性的值 + + + + + + + + + + +'下列 GUID 為專案公開 (Expose) 至 COM 時所要使用的 typelib ID + + +' 組件的版本資訊是由下列四項值構成: +' +' 主要版本 +' 次要版本 +' 組建編號 +' 修訂編號 +' +' 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 +' 指定為預設值: +' + + + diff --git a/97/97-6(VB.net)/97-6/My Project/Resources.Designer.vb b/97/97-6(VB.net)/97-6/My Project/Resources.Designer.vb new file mode 100644 index 0000000..8c4c582 --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ' + ' A strongly-typed resource class, for looking up localized strings, etc. + ' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ' + ' Returns the cached ResourceManager instance used by this class. + ' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("_97_6.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ' + ' Overrides the current thread's CurrentUICulture property for all + ' resource lookups using this strongly typed resource class. + ' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/97/97-6(VB.net)/97-6/My Project/Resources.resx b/97/97-6(VB.net)/97-6/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/97/97-6(VB.net)/97-6/My Project/Settings.Designer.vb b/97/97-6(VB.net)/97-6/My Project/Settings.Designer.vb new file mode 100644 index 0000000..fd76041 --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:2.0.50727.4013 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global._97_6.My.MySettings + Get + Return Global._97_6.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/97/97-6(VB.net)/97-6/My Project/Settings.settings b/97/97-6(VB.net)/97-6/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/97/97-6(VB.net)/97-6/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git "a/97/97-6(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" "b/97/97-6(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" new file mode 100644 index 0000000..d9c5d93 --- /dev/null +++ "b/97/97-6(VB.net)/97\345\271\264\345\267\245\347\247\221\346\212\200\350\227\235\347\253\266\350\263\275\347\254\2546\351\241\214.sln" @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "97年工科技藝競賽第6題", "97-6\97年工科技藝競賽第6題.vbproj", "{F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F52755CA-F1B2-4662-9BB8-F7A80AEE8C6E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal