首页 \ 问答 \ 运行时删除自己(Delete self while running)

运行时删除自己(Delete self while running)

我正在创建一个删除应用程序文件夹的卸载应用程序。 问题是我无法删除位于同一文件夹中的卸载程序应用程序导致其运行。 有没有办法在运行时删除应用程序,所以它只是在内存中。

        string Installation = UninstallRegister.Read("InstallationLocation");
        if (Directory.Exists(StartMenu))
        {
            Directory.Delete(StartMenu, true);
        }

最好的祝福


Im currently creating a uninstallation application which deletes the application folder. The problem is that i cant delete the uninstaller application which is in the same folder cause its running. Is there a way to delete the application while running, so its just in the memory.

        string Installation = UninstallRegister.Read("InstallationLocation");
        if (Directory.Exists(StartMenu))
        {
            Directory.Delete(StartMenu, true);
        }

Best regards


原文:https://stackoverflow.com/questions/6322318
更新时间:2023-08-09 08:08

最满意答案

你应该看到手册

要格式化其他语言的日期,您应该使用setlocale()strftime()函数而不是date()

setlocale(LC_TIME, 'es_ES');
echo strftime("%d-%h-%Y", strtotime($date));

这将为您提供所需的结果:

23-Ene-2017

请注意,为了显示西班牙语本地化,您必须安装西班牙语本地化。


Actually I use this in wordpress so I used date_i18n()

echo date_i18n('d-M-Y', strtotime( $date ));

相关问答

更多
  • function validateDateFormats(string $date, string $format='d/m/Y') { $d = DateTime::createFromFormat($format, $date); return $d && $d->format($format) == $date; } var_dump(validateDateFormats('20/4/1999')); var_dump(validateDateFormats('4/ ...
  • 因此,您知道日期需要一个整数( 作为来自纪元的Unix时间戳 )的第二个参数,这是可选的,默认情况下是当前时间戳。 时间戳 可选的timestamp参数是一个整数Unix时间戳,如果没有给出时间戳,该时间戳默认为当前本地时间。 换句话说,它默认为time()的值。 其次, $x = explode('-',$row['lastupdate'],0)和$x = array($row['lastupdate'])基本上是一样的,它并不是很多如果您将$x交给date() ,则是有意义的。 你可能打算做的是更多沿着 ...
  • 你应该看到手册 : 要格式化其他语言的日期,您应该使用setlocale()和strftime()函数而不是date() 。 setlocale(LC_TIME, 'es_ES'); echo strftime("%d-%h-%Y", strtotime($date)); 这将为您提供所需的结果: 23-Ene-2017 请注意,为了显示西班牙语本地化,您必须安装西班牙语本地化。 Actually I use this in wordpress so I used date_i18n() echo da ...
  • 我修好了它! 我忘了将变量Dim变暗为Date。 这是这样的: Dim BookingDate As String Dim BookingDate2 As String 但它必须是: Dim BookingDate As Date Dim BookingDate2 As Date 这对我来说是诀窍。 I fixed it! I forgot to Dim the variables to Date. It was like this: Dim BookingDate As String Dim Book ...
  • 这段代码从6月前开始给你: date('Y-m-d', strtotime('now -6 month')) 编辑: 并使用DateTime: echo (new DateTime('-6 months'))->format('Y-m-d'); This code get you 6 month ago from now: date('Y-m-d', strtotime('now -6 month')) EDIT: and use DateTime: echo (new DateTime('-6 month ...
  • 我将使用DateTime创建一个具有您的格式的对象,然后重新格式化它。 format('d/m/y'); //Output: 21/05/14 https://eval.in/208227 I would use DateTime to create an object with your format, and then reformat it.
  • 相关文章

    更多
  • Running Solr with Maven
  • HDFS patch前后Ganglia看到running processes变化的分析
  • Another MySQL daemon already running with the same unix socket.
  • 运行时编译执行一段代码
  • C程序访问Hadoop运行时遇到的各种问题以及解决方案
  • Hadoop运行时错误:Task process exit with nonzero status of 1
  • C程序访问Hadoop出现的各种编译错误和运行时各种类DefFound异常的解决方法
  • Memcached delete 删除key
  • HttpClient DELETE请求示例
  • solr delete query
  • 最新问答

    更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。