If File.Exists(File.DirInternal, "test.html") = False Then
Log("File test.html does not exist in DirInternal. Attempting to copy from Assets.")
Try
File.Copy(File.DirAssets,"test.html",File.DirInternal,"test.html")
Log("File copied successfully.")
Catch
Log("Error copying file: " & LastException.Message)
End Try
Else
Log("File test.html already exists in DirInternal.")
End If
If File.Exists(File.DirInternal, "test.html") Then
Log("Loading URL: file://" & File.DirInternal & "/test.html")
WebView1.LoadUrl("file://" & File.DirInternal & "/test.html")
Else
Log("Failed to load WebView. File test.html not found even after copy attempt.")
ToastMessageShow("Error: HTML file not found.", True)
End If
' به جای استفاده از File.DirInternal، مستقیماً از پوشه Assets استفاده کنید:
'WebView1.LoadUrl("file:///android_asset/test.html")
WebView1.LoadUrl("file://" & File.DirInternal & "/test.html")
وقتی میخوام فایل html رو تو webview نشون بدم فایل تو موبایل هست دسترسی هم داره اما وبویو با دستور زیر مواجه میشه
net:ERR_ACCESS_DENIED
هر راهی رو امتحان کردم درست نمیشه لطفا اگه کسی بلده کمک کنه میخوام فایل html رئ باهاش باز کنم
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید.
اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .
توجه: strong> مطلب ارسالی شما پس از تایید مدیریت برای همه قابل رویت خواهد بود.
سوال
maji 1
If File.Exists(File.DirInternal, "test.html") = False Then Log("File test.html does not exist in DirInternal. Attempting to copy from Assets.") Try File.Copy(File.DirAssets,"test.html",File.DirInternal,"test.html") Log("File copied successfully.") Catch Log("Error copying file: " & LastException.Message) End Try Else Log("File test.html already exists in DirInternal.") End If If File.Exists(File.DirInternal, "test.html") Then Log("Loading URL: file://" & File.DirInternal & "/test.html") WebView1.LoadUrl("file://" & File.DirInternal & "/test.html") Else Log("Failed to load WebView. File test.html not found even after copy attempt.") ToastMessageShow("Error: HTML file not found.", True) End If ' به جای استفاده از File.DirInternal، مستقیماً از پوشه Assets استفاده کنید: 'WebView1.LoadUrl("file:///android_asset/test.html") WebView1.LoadUrl("file://" & File.DirInternal & "/test.html")وقتی میخوام فایل html رو تو webview نشون بدم فایل تو موبایل هست دسترسی هم داره اما وبویو با دستور زیر مواجه میشه
net:ERR_ACCESS_DENIED
هر راهی رو امتحان کردم درست نمیشه لطفا اگه کسی بلده کمک کنه میخوام فایل html رئ باهاش باز کنم
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
به گفتگو بپیوندید
هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .
توجه: strong> مطلب ارسالی شما پس از تایید مدیریت برای همه قابل رویت خواهد بود.