Jump to content

Seçilen .exe'yi .ini Ye Kaydetmek Ve 2.tık Ta Açma


WolfmanTR_
 Share

Recommended Posts

arkadaşlar, şimdi bir .exe şeçilecek, bunu seçince .ini ye kaydedecek. buraya kadar sorun yok. ama 2. tık ta seçilen .exe yi .ini den(kaydedilen yoldan) okuyacak ve açacak . ben bu açma işlemini yapamadım

[CODE]
if nSayi == 1 then
nSayi=0
nDosya = INIPlus.ValueDoesExist("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu");
if nDosya == false then
nSecilen = Dialog.FileBrowse(true, "Driver Pack Seçiniz", _DesktopFolder, "Exe Files (*.exe)|*.exe|", "", "dat", false, false);
if nSecilen[1] ~= "CANCEL" then
INIFile.SetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu", nSecilen[1])
end
elseif nDosya == true then
elseif nSayi==0 then
nYol = INIFile.GetValue("AutoPlay\\Docs\\dps.ini","DriverPack","Dosyayolu")
Shell.Execute(nYol, "open", "", "", SW_SHOWNORMAL, false);
end
end
[/CODE]
Link to comment
Share on other sites

Global Functions:

[code]nSecim = 0;[/code]

xButton On Click:

[code]if nSecim == 0 then
sDosya = INIFile.GetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu");
if sDosya == "" then
nSecilen = Dialog.FileBrowse(true, "Driver Pack Seçiniz", _DesktopFolder, "Exe Files (*.exe)|*.exe|", "", "dat", false, false);
if nSecilen[1] ~= "CANCEL" then
INIFile.SetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu", nSecilen[1])
end
end
nSecim = 1
xButton.SetText(this, "Çalıştır")
else
nYol = INIFile.GetValue("AutoPlay\\Docs\\dps.ini","DriverPack","Dosyayolu")
Shell.Execute(nYol, "open", "", "", SW_SHOWNORMAL, false);
nSecim = 0;
xButton.SetText(this, "Seç")
end[/code]

Link to comment
Share on other sites

  • 1 yıl yıl...

ben burdakini değiştirmek istiyorum ama yapamadım nasıl bir kod ekleyecem ki şu şekilde olacak:

 

her program açıldığında 1 kere tıklıyorum açmıyor ikinci tıkladığımda açıyor ben bir kere kaydettiğimde hep onu hafızasında tutmasını istiyorum bunun için veri tabanı mı gerekiyor??????

Link to comment
Share on other sites

  • 2 hafta sonra ...

Global Functions:
 

nSecim = 0;
xButton On Click:

if nSecim == 0 then
sDosya = INIFile.GetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu");
	if sDosya == "" then
	nSecilen = Dialog.FileBrowse(true, "Driver Pack Seçiniz", _DesktopFolder, "Exe Files (*.exe)|*.exe|", "", "dat", false, false);
		if nSecilen[1] ~= "CANCEL" then
		INIFile.SetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu", nSecilen[1])
		end
	end
nSecim = 1
xButton.SetText(this, "Çalıştır")	
else
nYol = INIFile.GetValue("AutoPlay\\Docs\\dps.ini","DriverPack","Dosyayolu")
Shell.Execute(nYol, "open", "", "", SW_SHOWNORMAL, false);
nSecim = 0;
xButton.SetText(this, "Seç")	
end

 

 

ben burdaki kodu normal buton için yazdım xButton yazan yere Button yazdım ama programı çalıştırdığımda program sonlandırıldı diyor

 

http://www.tnctr.com/topic/213743-treelist-ile-ao-rnei/ Burdaki Programın içine yazıyorum bu kodları ama sonlandırıyor

 

yani yazdığım kodlar

 

Global Functions:

nSecim = 0;

Button Kodu:

    if nSecim == 0 then
    sDosya = INIFile.GetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu");
    if sDosya == "" then
    nSecilen = Dialog.FileBrowse(true, "Driver Pack Seçiniz", _DesktopFolder, "Exe Files (*.exe)|*.exe|", "", "dat", false, false);
    if nSecilen[1] ~= "CANCEL" then
    INIFile.SetValue("AutoPlay\\Docs\\dps.ini", "DriverPack", "Dosyayolu", nSecilen[1])
    end
    end
    nSecim = 1
    Button.SetText(this, "Çalıştır")    
    else
    nYol = INIFile.GetValue("AutoPlay\\Docs\\dps.ini","DriverPack","Dosyayolu")
    Shell.Execute(nYol, "open", "", "", SW_SHOWNORMAL, false);
    nSecim = 0;
    Button.SetText(this, "Seç")    
    end

nerde yanlışlık yapıyorum da programı sonlandırıyor

Edited by kaan_karabey
Link to comment
Share on other sites

ilk seferde yolu kaydeder, daha sonraki tıklamalarda direk kaydedilen dosyayı açar.

sYol = INIFile.GetValue(_SourceFolder .. "\\AutoPlay\\Docs\\data.ini", "genel", "yol");
if sYol == "" then
tDosya = Dialog.FileBrowse(true, "Dosya Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", false, true);
	if tDosya[1] ~= "CANCEL" then
	INIFile.SetValue(_SourceFolder .. "\\AutoPlay\\Docs\\data.ini", "genel", "yol", tDosya[1]);
	end
else
sKlasor = String.SplitPath(sYol).Drive .. String.SplitPath(sYol).Folder;
File.Run(sYol, "", sKlasor, SW_SHOWNORMAL, false);
end
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...