我已经有一个准备建立的项目.目前,我正在使用visual studio 2013.
但是,我不知道如何在visual studio 2013中创建MSI设置,但是对于visual studio 2010,有很多教程讨论如何在visual studio 2010中创建设置.
这是否意味着我需要安装visual studio 2010才能为我的项目创建应用程序设置?
在visual studio 2013中创建应用程序设置的最简单方法是什么?
我如何获得用于调试代码的Unity3D,以及我现在只需编写代码脚本的Visual Studio 2013.示例:与用于调试的Flash Professional和用于脚本的FlashDevelop类似.
我的问题是,我如何获得与Visual Studio 2013的Unity3D链接.我已经在互联网上搜索,并发现Unity3D仅适用于VisualStudio 2010.
是否可以使用Visual Studio 2013 创建Java应用程序?
因为我不喜欢使用NetBeans或Eclipse,我更喜欢在这些SDK上使用Visual Studio.
谢谢.
我想在Windows窗体中显示图像,但我已经这样做了,图像没有出来.
我哪里做错了?
这是代码:
private void Images(object sender, EventArgs e)
{
PictureBox pb1 = new PictureBox();
pb1.Image = Image.FromFile("../SamuderaJayaMotor.png");
pb1.Location = new Point(100, 100);
pb1.Size = new Size(500, 500);
this.Controls.Add(pb1);
}
Run Code Online (Sandbox Code Playgroud) 我已经可以创建一个打印来打印我的Windows窗体中的文件.但是,每当我添加此代码时:
printDialog.PrinterSettings.DefaultPageSettings.Landscape = true;
Run Code Online (Sandbox Code Playgroud)
我看不到页面的Orientation成为LandScape,它仍然是Portrait.
如何将LandScape设为默认值?因此,每当我单击PrintPreview或PrintFile时,页面的方向将变为LandScape,而不是Portrait.
这是代码:
private void PrintPreview(object sender, EventArgs e)
{
PrintPreviewDialog _PrintPreview = new PrintPreviewDialog();
_PrintPreview.Document = printDocument1;
((Form)_PrintPreview).WindowState = FormWindowState.Maximized;
_PrintPreview.ShowDialog();
}
private void PrintFile(object sender, EventArgs e)
{
PrintDialog printDialog = new PrintDialog();
printDialog.Document = printDocument1;
printDialog.UseEXDialog = true;
if (DialogResult.OK == printDialog.ShowDialog())
{
printDocument1.DocumentName = "Test Page Print";
printDocument1.Print();
}
}
Run Code Online (Sandbox Code Playgroud) 我试图授予用户访问该文件夹的权限,但是当我尝试运行该程序时,错误说:Some or all identity references could not be translated
.
这是我正在使用的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Security;
using System.Security.AccessControl;
using System.Security.Principal;
using System.Management;
using System.Management.Instrumentation;
namespace FolderLock
{
public partial class Lock : Form
{
public Lock()
{
InitializeComponent();
SetAccess();
}
private void Lock_Load(object sender, EventArgs e)
{
}
public void SetAccess()
{
DirectoryInfo myDirectoryInfo = new DirectoryInfo("C:/Users/Trov/Desktop/Test");
DirectorySecurity myDirectorySecurity = myDirectoryInfo.GetAccessControl();
string …
Run Code Online (Sandbox Code Playgroud) 如果所选行为0,我想显示消息"您没有选择任何行".
但是,即使我单击datagridview中的第一行,我跟踪它,所选行总是给我0.
为什么会那样?
这是代码:
MessageBox.Show(dataGridView1.SelectedRows.Count.ToString()); // below function always run, because the selected rows always 0, even i clicked the first row in datagridview (when run the program)
if (dataGridView1.SelectedRows.Count == 0)
{
if (choice.comboBox1.Text == "English")
{
System.Media.SoundPlayer sound = new System.Media.SoundPlayer(@"C:\Windows\Media\Windows Exclamation.wav");
sound.Play();
MessageBox.Show("You Have Not Selected Any Rows!", "Error");
}
}
else
{
DeleteDatabase(sender, e);
}
Run Code Online (Sandbox Code Playgroud) 我已经部署了我的应用程序以备另一个用户(另一台计算机)使用,但是当我尝试将数据添加到数据库时,我得到了错误
操作必须使用可更新的查询
错误是这样的(这是我已经部署我的程序并在应用程序下运行,而不是在Visual Studio下运行):
但它在visual studio下运行得很好,这样的图像(请注意,一旦我点击提交按钮,它就会出现在数据库中,并将其显示在datagridview上,如下图所示):
而且我还有另一个问题,删除功能没有运行,添加和删除错误出现在我部署我的程序后,但我会在另一个线程上发布.
我该如何解决这个问题?
c# datagridview visual-studio-2010 ms-access-2010 visual-studio-2013
我想让我的应用程序计算折扣价。这是我找到折扣价的方法,但是我有一个小问题(逻辑问题):
private void UpdateDiscount(object sender, EventArgs e)
{
decimal actualPrice = 0;
decimal discount = 0;
int calculateDiscount = 0;
int totalDiscount = 0;
int afterDiscount = 0;
int totalAfterDiscount = 0;
int total = 0;
if (numericTextBox1.TextLength == 6)
{
this.numericUpDown2.Enabled = true;
discount = Convert.ToInt32(this.numericUpDown2.Value);
calculateDiscount = Convert.ToInt32(discount / 100);
totalDiscount = calculateDiscount;
if (!string.IsNullOrEmpty(this.numericTextBox3.Text.ToString()))
{
actualPrice = Convert.ToDecimal(this.numericTextBox3.Text);
}
else
{
numericTextBox3.Text = "";
}
afterDiscount = Convert.ToInt32(actualPrice * totalDiscount);
totalAfterDiscount = Convert.ToInt32(actualPrice);
total = Convert.ToInt32(totalAfterDiscount - …
Run Code Online (Sandbox Code Playgroud) 我创建了一个应用程序,其中的信息基于我在数据库中的内容.
当用户键入数据库中存在该代码的代码时,信息将会出现并填满剩余的文本框.
这是我的数据库:
这是我输入" SM0001"时程序的屏幕截图.
请注意,在"产品代码文本框"中输入" SM0001 ","数量文本框","描述文本框","子文本框"和"总文本框"之前是空的.
当我在"产品代码"文本框中键入" SM0001 "时,它会显示属于我输入的代码的所有数据.
注意:数据库中的价格是程序中的子总计
这是我的问题:当我输入" SM0002 "时,在"产品代码文本框"中(我输入的代码不在数据库中,产品代码只在数据库中有" SM0001 "),程序停止并给了我错误" 输入字符串格式不正确",这里指出:
price = Convert.ToDecimal(this.numericTextBox2.Text);
Run Code Online (Sandbox Code Playgroud)
这是必要的代码:
private void textBox_TextChanged(object sender, EventArgs e)
{
UpdatePrice(sender, e);
}
private void UpdatePrice(object sender, EventArgs e)
{
decimal quantity = 0;
decimal price = 0;
int total = 0;
if (numericTextBox1.TextLength == 6)
{
this.numericUpDown1.Enabled = true;
quantity = Convert.ToInt32(this.numericUpDown1.Value);
price = Convert.ToDecimal(this.numericTextBox2.Text);
total = Convert.ToInt32(quantity * price);
if (numericUpDown1.Value > 0)
{
this.numericTextBox3.Text = total.ToString(); …
Run Code Online (Sandbox Code Playgroud) 客户已要求我制作销售点系统,并且我一直在使用本地数据库(Microsoft Access 2010).
所以,我一直在想这个问题:如果计算机上安装了Microsoft Access以及哪个版本,应用程序如何检测?
我在网上看到了这个,我想不出这是关于什么的:
他们创建了名为障碍的布尔值并将其设置为false.
public bool obstacles = false;
Run Code Online (Sandbox Code Playgroud)
但是,这条线是什么:
obstacles = obstacles ? false : true;
if (obstacles)
{
transform.renderer.material.color = new Color(.5f, .5f, 0.0f);
}
else
{
transform.renderer.material.color = Color.white;
}
Run Code Online (Sandbox Code Playgroud)
我知道if和else功能,当有障碍物时,将材料转换为指定的颜色,或者如果没有障碍物,将材料变成白色.但是,这条线是什么:障碍=障碍?false:是的;
谢谢..抱歉这个新手问题.