Skip to content
Browse files

增加图标

Signed-off-by: Henry Yang
  • Loading branch information...
1 parent 4f2a61a commit c62ed032af6b8a37694dbaec75ba1722e392161f Henry Yang committed Apr 11, 2012
View
3 .gitignore
@@ -1,3 +1,4 @@
bin/
obj/
-*.suo
+*.suo
+*.user
View
41 ExcelApplication/ExcelApplication/ExcelApplication.csproj
@@ -14,6 +14,21 @@
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@@ -34,6 +49,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>a3.ico</ApplicationIcon>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="EPPlus, Version=3.0.0.2, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -91,9 +109,32 @@
</Compile>
</ItemGroup>
<ItemGroup>
+ <Content Include="a3.ico" />
<Content Include="Tools\EPPlus.dll" />
<Content Include="Tools\EPPlus.XML" />
</ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include=".NETFramework,Version=v4.0">
+ <Visible>False</Visible>
+ <ProductName>Microsoft .NET Framework 4 %28x86 和 x64%29</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
30 ExcelApplication/ExcelApplication/Form1.cs
@@ -16,11 +16,11 @@ public Form1()
public static List<string> GetSheetNames(string path)
{
List<string> ary = new List<string>();
- Object refmissing = System.Reflection.Missing.Value;
+ Object missing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel._Application exc = new Microsoft.Office.Interop.Excel.Application();
exc.Visible = false;
Microsoft.Office.Interop.Excel.Workbooks workbooks = exc.Workbooks;
- workbooks._Open(path, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing, refmissing);
+ workbooks._Open(path, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing, missing);
for (int i = 0; i < exc.Worksheets.Count; i++)
{
Microsoft.Office.Interop.Excel.Worksheet sheet = (Microsoft.Office.Interop.Excel.Worksheet)exc.Worksheets.get_Item(i + 1);
@@ -61,7 +61,7 @@ public bool dataTotal(int col)
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message, "Error");
+ MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
@@ -99,7 +99,7 @@ private void calculatorToolStripMenuItem_Click(object sender, EventArgs e)
}
catch
{
- MessageBox.Show("File Not Found!", "Error");
+ MessageBox.Show("File Not Found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
@@ -110,9 +110,9 @@ private void btnLoadData_Click(object sender, EventArgs e)
{
ExcelLib.IExcel tmp = ExcelLib.PreExcel.GetExcel(txtPath.Text);
if (tmp == null)
- MessageBox.Show("File Not Found!", "Error");
+ MessageBox.Show("File Not Found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (!tmp.Open())
- MessageBox.Show("File Not Found!", "Error");
+ MessageBox.Show("File Not Found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
tmp.CurrentSheetIndex = comboBox1.SelectedIndex;
int columnCount = tmp.GetColumnCount();
@@ -144,7 +144,7 @@ private void btnLoadData_Click(object sender, EventArgs e)
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message, "Error");
+ MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
btnLoadData.Enabled = false;
}
@@ -165,7 +165,7 @@ private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
ExcelLib.IExcel tmp = ExcelLib.PreExcel.GetExcel(txtPath.Text);
if (tmp == null)
- MessageBox.Show("File Not Found!", "Error");
+ MessageBox.Show("File Not Found!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
int columnCount = dataGridView1.ColumnCount;
int rowCount = dataGridView1.RowCount;
@@ -190,20 +190,20 @@ private void saveToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (sheetName.GetHashCode() == comboBox1.GetItemText(comboBox1.Items[i]).GetHashCode())
{
- sheetName += " 2";
+ sheetName += "(2)";
}
}
if (tmp.Save(sheetName, array))
{
comboBox1.DataSource = GetSheetNames(txtPath.Text);
- MessageBox.Show("File Save Success", "Information");
+ MessageBox.Show("File Save Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
tmp.Close();
}
catch (Exception ex)
{
- MessageBox.Show(ex.Message, "Error");
+ MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
@@ -247,7 +247,7 @@ private void removeColumnToolStripMenuItem_Click(object sender, EventArgs e)
dataGridView1.Rows[i].Cells[2].Value = (rowValue[i].Length > 6) ? rowValue[i].Substring(0, 6) : rowValue[i];
}
dataGridView1.Columns[2].HeaderCell.Value = "铸锭编号";
- MessageBox.Show("Delete And Sort Records Success", "Information");
+ MessageBox.Show("Delete And Sort Records Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
//dataGridView1.Columns[3].DefaultCellStyle.Format = "c";
}
@@ -256,21 +256,21 @@ private void dateToolStripMenuItem_Click(object sender, EventArgs e)
{
int selectCol = 3;
if (dataTotal(selectCol))
- MessageBox.Show("Processed Data Success", "Information");
+ MessageBox.Show("Processed Data Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void ingotToolStripMenuItem_Click(object sender, EventArgs e)
{
int selectCol = 2;
if (dataTotal(selectCol))
- MessageBox.Show("Processed Data Success", "Information");
+ MessageBox.Show("Processed Data Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void cuttingToolStripMenuItem_Click(object sender, EventArgs e)
{
int selectCol = 4;
if (dataTotal(selectCol))
- MessageBox.Show("Processed Data Success", "Information");
+ MessageBox.Show("Processed Data Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
View
6 ExcelApplication/ExcelApplication/Lib/Excel2007.cs
@@ -46,7 +46,7 @@ public int CurrentSheetIndex
if (value != currentSheetIndex)
{
if (value >= sheetCount)
- throw new Exception("工作表序号超出范围");
+ throw new Exception("Beyond the scope of work table serial number!");
currentSheetIndex = value;
currentSheet = book.Worksheets[currentSheetIndex + 1];
}
@@ -71,7 +71,7 @@ public bool Open()
}
catch (Exception ex)
{
- throw new Exception("打开文件失败,详细信息:" + ex.Message);
+ throw new Exception("Open file fail,information: " + ex.Message);
}
return true;
}
@@ -109,7 +109,7 @@ public bool Save(string newSheetName, string[,] array)
}
catch (Exception ex)
{
- throw new Exception("保存文件失败,详细信息:" + ex.Message);
+ throw new Exception("Save file fail,information: " + ex.Message);
}
return true;
}
View
BIN ExcelApplication/ExcelApplication/a3.ico
Binary file not shown.

0 comments on commit c62ed03

Please sign in to comment.
Something went wrong with that request. Please try again.