اجرای خودکار اسکریپت

سلاماگر بخوام بعد از اینکه پروژه اجرا میشه ، یه اسکریپت بصورت خودکار اجرا شود چی کار باید کرد؟ بدون اینکه کاربر روی دکمه ای کلیک کنه میخوام اسکریپت اجرا بشه.
 
میخوام تویه صفحه اول یه Progress Bar بصورت خودکار شروع به پر شدن کنه . این کد رو کجا باید قرار بدم ؟


کد:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] For[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101][/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginSet[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","x")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginRun[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","UpdateProgressBar")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]Pause[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x
[/COLOR][/SIZE][/COLOR][/SIZE]

توی اسکریپت صفحه Page گذاشتم منتها دستورات رو اجرا میکنه و بعدش صفحه که نمایش داده میشه Progress Bar پر شده رو نشون میده.
 

MahmoodM30

مدیر <A href="http://forum.majidonline.com/forums/
اسکریپت رو ایجاد کنید بعدش توی پیج استارت کد مربوط به اجرای اسکریپت رو وارد کنید وسلام
 

MahmoodM30

مدیر <A href="http://forum.majidonline.com/forums/
این پلاگین باید یه کد برای مخفی کردن داشته باشه بهتره نمونه مثال کنارش رو نگاهی بندازید

در ضمن نمونه زیاد توی انجمن هست که یکی از عالی ترین های اونا نمونه ای هست که جواد عزیز درست کردن که من همیشه از اون روش برای کار هام استفاده میکنم
 

alimaya

Active Member
سلام. همونطور که آقا محمود گفتن شما کد بالا رو در یه شیء اسکریپت به نام Script قرار بدید. بعد تو Page Start شیء اسکریپت رو با
کد:
ScriptTimer("Script","100")
فراخوانی کنید مشکلتون حل میشه. البته برای فراخوانیش میتونید از تابع RunScript هم استفاده کنید ولی با توجه به تجربه کم من باز هم به نتیجه قبلی میرسید.
بهترین نمونه ای هم که درمورد progressbar دیدم ساخته آقای پرستگاری هست که در لینک زیر براتون میذارم.
 

پیوست ها

  • Progress.zip
    10.9 کیلوبایت · بازدیدها: 28
لطف کردید.

ولی میخوام با وقتی پروژه Run میشه Progress Bar خودش خودکار اجرا بشه. نمیخوام کاربر رویه یه دکمه کلیک کنه !
 
کاملا حق با شماست. آقای M javad

من این کدها رو در بخش استارت Page نوشتم.
کد:
[B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080] PluginRun[/COLOR][/SIZE][/COLOR][/SIZE][/B][LEFT][/LEFT]

[SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","Show")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginSet[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginRun[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","ShowProgressBar")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]ScriptTimer[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("script","[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1000[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE]

و بعد تویه اسکریپت گفتم

کد:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff] For[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginSet[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","x")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginRun[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","UpdateProgressBar")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]Pause[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x
[/COLOR][/SIZE][/COLOR][/SIZE]


باور کنید اجرا نکرد.

که کدی که شما گذاشتید دستورات زیر رو تویه اسکریپت گذاشتید و دستور Scripttimer رو فقط تویه استارت گذاشتید.
کد:
[B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080] PluginRun[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","Show")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginSet[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginRun[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","ShowProgressBar")
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]***********
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]For[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x=[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]To[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] [/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101][/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginSet[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","x")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]PluginRun[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("PlugIn","UpdateProgressBar")
[/COLOR][/SIZE][/COLOR][/SIZE][B][SIZE=2][COLOR=#000080][SIZE=2][COLOR=#000080]Pause[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]("[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]100[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101]")
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Next[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#010101][SIZE=2][COLOR=#010101] x
[/COLOR][/SIZE][/COLOR][/SIZE]
 
آخرین ویرایش:

m javad

کاربر متخصص
من این کدها رو در بخش استارت Page نوشتم.
و بعد تویه اسکریپت گفتم.
باور کنید اجرا نکرد.
روشتون درست بوده
چون فرقی نداره که همه توی اسکریپت باشه و یا توی page start
عجیب هست که اجرا نمیکرده
شاید یه اشتباه تایپی ، حروف کوچیک و بزرگ و .. وجود داره
و شاید اشکال از پلاگین هست که در زمان formCreate نمیتونه خودش رو هندل کنه و نمایش بده
به هر جهت موفق باشید
 

جدیدترین ارسال ها

بالا