Jump to content

Ini Ile Dosya Yolu Saklama


kimtakar
 Share

Recommended Posts

ams ile usb belleğimi daha kullanışlı yapabilmek adına bikaç projem oldu(http://www.tnctr.com/topic/233270-ebed-amiralv11-gelithtirme/) fakat geliştirmede yeterli ilgiyi göremedim, uzun lafın kısası yine benzer bi proje ile yardımınıza ihtiyacım var

sorunlar:

1- ini dosyasına kaydettiğim dosya yolu, örnek= "C://Resimler/avatar/image.png" şeklinde oluyor ancak

uygulamayı usb bellek ile beraber taşıyacağımdan başka bir pc de bu ini dosyası bir işe yaramıyor,

yapmak isteğim ini dosyasına katdediceğim dosya yolu "Resimler/avatar/image.png" şeklinde olması.

 

bunu halledersek büyük bi kısmı bitmiş olucak, ilgilenicek üsdat ve arkadaşlara şimdiden teşekkürler...

 

link:

http://yadi.sk/d/muYS2AjTFMyaf

 

kullanıcı adı: admin

şifre: 12345

Link to comment
Share on other sites

INI'ye kaydedeceğin dosya yollarındaki dosyalar bellek içinde olmayacak mı?

Kaydederken "/Resimler/avatar/image.png" şeklinde kaydet sadece C: kısmı değişeceğinden INIden çağırdığın veriyi şu şekle getirip kullan.

_SourceFolder..INIFile.GetValue(...)
Link to comment
Share on other sites

 

result = Shell.GetFolder(SHF_MYPICTURES);
 
 
Koduyla alabilirsiniz Resimlerim yolunu.

 

iniden çağıracağı dosya yollarındaki dosyalar her PC de olmayacağından bu işe yaramaz.

 

Projeyi yeni açıp baktım;

Projede Ayarlar sayfasındaki avatar resmindeki aşağıdaki ilgili kodlarda şu değişikliği yap. INI'ye sadece dosya adı ve uzantısını yazdırır.

sFilepath = String.SplitPath(nSecilen[1])
INIFile.SetValue("AutoPlay\\Docs\\data.ini", "avatar", "1", sFilepath.Filename..sFilepath.Extension)

Geri çekerken de şu şekilde çekersin.

_SourceFolder.."\\Resimler\\avatar\\"..INIFile.GetValue("AutoPlay\\Docs\\data.ini", "avatar", "1")

Edited by xarax
Link to comment
Share on other sites

""""""""""""""""""""""
tDosya = Dialog.FileBrowse(true, "Avatar Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", true, true)
if tDosya[1] ~= "CANCEL" then
for i,v in pairs(tDosya) do
StatusDlg.Show()
File.Copy(v, _SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(v).Filename .. String.SplitPath(v).Extension, false, true, false, true, nil)
StatusDlg.Hide()
end
 
sFilepath = String.SplitPath(nSecilen[1])
if nSecilen[1] ~= "CANCEL" then
INIFile.SetValue("AutoPlay\\Docs\\data.ini", "avatar", "1", sFilepath.Filename..sFilepath.Extension)
end
end
""""""""""""""""""""""
basit bi hata yapıyorum ama nerde çözemedim
Link to comment
Share on other sites

tek olucak


dosyayı C:\Users\"Kullanıcı ismi"\AppData\Local\Temp  yolunda çalıştırabilirseniz 

buna göre kod %temp%
örneğin: %temp%Resimler/avatar/image.png

uygulama usb üzerinde çalışıcak, temp dosyasına açmıcak yani, ilgin için eyvallah

Link to comment
Share on other sites

O zaman for döngüsüne sokmanıza gerek yok.

tDosya = Dialog.FileBrowse(true, "Avatar Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", false, true)
if tDosya[1] ~= "CANCEL" then
StatusDlg.Show()
File.Copy(tDosya[1], _SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(v).Filename .. String.SplitPath(v).Extension, false, true, false, true, nil)
StatusDlg.Hide()
end

Yazmanız yeterli.

Link to comment
Share on other sites

O zaman for döngüsüne sokmanıza gerek yok.

tDosya = Dialog.FileBrowse(true, "Avatar Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", false, true)
if tDosya[1] ~= "CANCEL" then
StatusDlg.Show()
File.Copy(tDosya[1], _SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(v).Filename .. String.SplitPath(v).Extension, false, true, false, true, nil)
StatusDlg.Hide()
end

Yazmanız yeterli.

hata verdi üsdat 4de takıldı

Link to comment
Share on other sites

tDosya = Dialog.FileBrowse(true, "Avatar Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", false, true)
if tDosya[1] ~= "CANCEL" then
StatusDlg.Show()
File.Copy(tDosya[1], _SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension, false, true, false, true, nil)
StatusDlg.Hide()
end
Link to comment
Share on other sites

tDosya = Dialog.FileBrowse(true, "Avatar Seçin", _DesktopFolder, "Tüm Dosyalar (*.*)|*.*|", "", "", false, true)
if tDosya[1] ~= "CANCEL" then
StatusDlg.Show()
File.Copy(tDosya[1], _SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension, false, true, false, true, nil)
StatusDlg.Hide()
end

usta hata yok ancak bir sorun daha olucak, diceksinki "çok oldun!" ama bunu nasıl göstericem?

Link to comment
Share on other sites

 

İster böyle;

Image.Load("Image1",_SourceFolder .. "\\Resimler\\avatar\\" .. String.SplitPath(tDosya[1]).Filename .. String.SplitPath(tDosya[1]).Extension)

İster böyle yapabilirsiniz

Image.Load("Image1",tDosya[1])

göstermedi, ancak şöyle bir ayrıntı var, resmi farklı page de göstermem gerekiyo

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...