是否可以在C#中创建一个能够在某些条件下删除自己的应用程序.
我需要为我的应用程序编写更新程序,但我不希望在更新过程后留下可执行文件.
有一个官方的.Net OneClick但由于与我的HTTP服务器有些不兼容以及OneClick本身的一些问题,我不得不自己制作一个.
乔治.
[编辑]更多细节:
我有:Application Executable下载更新程序("补丁",但不完全)这个"补丁"更新应用程序可执行文件本身.
应用程序执行如下:
Application: Start -> Check Version -> Download new Updater -> Start Updater -> exit;
Updater: Start -> do it's work -> start Application Executable -> self delete (this is where I get stuck);
Run Code Online (Sandbox Code Playgroud) 我正在使用特定应用程序的图表,我需要将渲染的3D饼图的视角和饼图标签名称中的自动标签值更改为相应的饼图值.
这是图表的外观:
这是我初始化它的方式:
Dictionary<string, decimal> secondPersonsWithValues = HistoryModel.getSecondPersonWithValues();
decimal[] yValues = new decimal[secondPersonsWithValues.Values.Count]; //VALUES
string[] xValues = new string[secondPersonsWithValues.Keys.Count]; //LABELS
secondPersonsWithValues.Keys.CopyTo(xValues, 0);
secondPersonsWithValues.Values.CopyTo(yValues, 0);
incomeExpenseChart.Series["Default"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie;
incomeExpenseChart.Series["Default"].Points.DataBindXY(xValues, yValues);
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.Enable3D = true;
incomeExpenseChart.Series["Default"].CustomProperties = "PieLabelStyle=Outside";
incomeExpenseChart.Legends["Default"].Enabled = true;
incomeExpenseChart.ChartAreas["Default"].Area3DStyle.LightStyle = System.Windows.Forms.DataVisualization.Charting.LightStyle.Realistic;
incomeExpenseChart.Series["Default"]["PieDrawingStyle"] = "SoftEdge";
Run Code Online (Sandbox Code Playgroud)
基本上我使用HistoryModel.getSecondPersonWithValues();to get对查询数据库中的数据,Dictionary<string, decimal>其中key是person,值是ammount.
我需要的是能够将标记的标签从人名更改为ammounts或添加另一个具有相同颜色的ammounts标签(参见图像).

另一个问题是我需要改变3D饼图的视角.也许这很简单,我只是不知道所需的属性,或者我可能需要覆盖一些油漆事件.无论哪种方式都会受到任何影响.
在此先感谢乔治.
问题很复杂,但我会详细解释.
目标是创建一个函数,它将返回给定字符串的下一个"步骤".
例如
String.Step("a"); // = "b"
String.Step("b"); // = "c"
String.Step("g"); // = "h"
String.Step("z"); // = "A"
String.Step("A"); // = "B"
String.Step("B"); // = "C"
String.Step("G"); // = "H"
Run Code Online (Sandbox Code Playgroud)
直到这里它很容易,但考虑到输入IS字符串它可以包含多于1个字符,并且该函数必须像这样.
String.Step("Z"); // = "aa";
String.Step("aa"); // = "ab";
String.Step("ag"); // = "ah";
String.Step("az"); // = "aA";
String.Step("aA"); // = "aB";
String.Step("aZ"); // = "ba";
String.Step("ZZ"); // = "aaa";
Run Code Online (Sandbox Code Playgroud)
等等...
这并不需要扩展基类String类.
我试图通过每个字符的ASCII值来解决这个问题,但是却遇到了包含2个字符的字符串.
如果有人能提供该功能的完整代码,我将非常感激.
提前致谢.
编辑 *对不起我之前忘了提到函数"重新分析"自生成的字符串,当它的长度达到n时.
continuation of this function will be smth like this. for example …Run Code Online (Sandbox Code Playgroud) 问题是获取表列数据并将其用作IN函数的值列表;
在这个例子中,我创建了2个表:电影和流派
表"电影"包含3列:id,name和流派.表"genres"包含2列:id和name.
+- movies-+
| |- movie_id - int(11) - AUTO_INCREMENT - PRIMARY
| |- movie_name - varchar(255)
| |- movie_genres - varchar(255)
|
|
+- genres-+
|- genre_id - int(11) - AUTO_INCREMENT - PRIMARY
|- genre_name - varchar(255)
Run Code Online (Sandbox Code Playgroud)
两个表都包含一些虚拟数据:
+----------+------------+--------------+
| movie_id | movie_name | movie_genres |
+----------+------------+--------------+
| 1 | MOVIE 1 | 2,3,1 |
| 2 | MOVIE 2 | 2,4 |
| 3 | MOVIE 3 | 1,3 |
| 4 | MOVIE 4 | …Run Code Online (Sandbox Code Playgroud) 是否有可能显示上标字符(不仅是数字)的alert(), confirm()或prompt()对话盒在JavaScript?
由于某些原因,我需要插入一个文本:
2后跟上标'n'2 ^ n
进入JavaScript警报,确认和提示框.快速谷歌搜索确实有帮助但不完全我找到了一种方法来使用Unicode \ u00B字符在对话框中显示上标数字,但它不适用于字符
alert('2\u00B2'); shows correctly 2^2
alert('2\u00Bn'); shows 2u00Bn
Run Code Online (Sandbox Code Playgroud)
因此,目标是显示一个上标而不是数字的字符.
^用作Power并显示下一个字符是上标的,以防万一有人感到困惑.