Posted: Sat Jul 18, 2020 8:19 am Post subject: How use find dialog or file dialog to delete a file? SOLVED
As topic post. I want to know that in CE Lua
EDIT: SOLVED
Code:
f = createForm()
b = createButton(f)
file_dialog = createOpenDialog(f)
function delfile()
file_dialog.InitalDir = os.getenv('%USERPROFILE%')
file_dialog.Filter = 'Text files|*.TXT;*.txt|All files (*.*)|*'
file_dialog.execute()
local file_name = file_dialog.FileName
if MessageDialog('Do you really want to delete this file?', mtConfirmation, mbYes, mbNo, mbCancel, 0) == mrNo then
return 0
else
os.remove(file_name)
end
end
f.show()
b.OnClick = delfile
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum