PDA

View Full Version : در مورد این خطا به من کمک نمائید .



saniak_robot
یک شنبه 12 شهریور 1385, 11:20 صبح
با سلام
من وقتی میخوام تو سایت دایرکتوری بسازم این پیغام خطا رو می بینم . دوستان اگه اطلاعاتی در مورد این خطا دارن کمک کنن .

با تشکر





Could not find a part of the path "D:\".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path "D:\".

Source Error:


Line 56: else
Line 57: if not directory.exists(Server.MapPath("../aza/aks") & "\" & txtuser.text) then
Line 58: Directory.CreateDirectory(Server.MapPath("../aza/aks") & "\" & txtuser.text)
Line 59: end if
Line 60: Try

Behrouz_Rad
یک شنبه 12 شهریور 1385, 12:18 عصر
Server.MapPath(".") & "\aza\aks\" & txtuser.Text

saniak_robot
یک شنبه 12 شهریور 1385, 12:34 عصر
بهروز جان نشد .:گریه:
این خطا چند روزیه اذیتم می کنه . نمی دونم از چیه لطفا کمک کنید .

دورباره همون خطا رو میده :




Could not find a part of the path "D:\".
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path "D:\".

Source Error:


Line 56: else
Line 57: if not directory.exists(Server.MapPath(".") & "\aza\aks\" & txtuser.Text) then
Line 58: Directory.CreateDirectory(Server.MapPath(".") & "\aza\aks\" & txtuser.Text)
Line 59: end if
Line 60: Try

Behrouz_Rad
یک شنبه 12 شهریور 1385, 12:49 عصر
بهروز جان خودتی! من بهروز راد هستم:چشمک:

1) این خطا بر روی سیستم خودت رخ میده یا بر روی سرور؟
2) txtUser رو هم که انشاا... حتما مقداری توش وارد می کنی؟

saniak_robot
یک شنبه 12 شهریور 1385, 13:24 عصر
رو سرور خطا می ده و txtuser هم پر می شه بهروز جان :بامزه:

دستمون و بگیر .

با تشکر

Behrouz_Rad
یک شنبه 12 شهریور 1385, 13:41 عصر
به این میگن گام به گام تا رفع مشکل!
متد CreateDirectory برای عملکردش نیاز به دسترسی به درایو اصلی داره! یعنی "\:D"
از اونجایی که سرور به دلیل مسائل امنیتی معمولا به برنامه نویس اجازه ی دسترسی به مسیر ریشه رو نمیده، به همین خاطر خطای فوق رخ میده.
شاید بشه اسمش رو یک باگ در VS.NET گذاشت!
فکر می کنم اگر از یک تابع API برای ایجاد دایرکتوری استفاده کنی بتونی مشکل رو حل کنی.
با تابع mkDir (از توابع VB.NET) هم امتحان کن.
قبلا در این باره پاسخگو بودم:
http://barnamenevis.org/forum/showthread.php?t=19144

موفق باشید.

saniak_robot
یک شنبه 12 شهریور 1385, 14:30 عصر
گفتید که از kernel32 استفاده کنم . چجوری بهش مسیر بدم ، کجا بذارمش ؟ آخه خطای زیر رو میده :




Server Error in '/' Application.
--------------------------------------------------------------------------------

Error calling DLL D:\Webspace\akbarzad\hitka\hitka.com\www\mng\aza\a ks\saniak), Error Code: -1
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ApplicationException: Error calling DLL D:\Webspace\akbarzad\hitka\hitka.com\www\mng\aza\a ks\saniak), Error Code: -1

Source Error:


Line 45: Dim returnCode As Integer = _mkdir("d:\webspace\akbarzad\hitka\hitka.com\www\mng\")
Line 46: If returnCode <> 0 Then
Line 47: Throw New ApplicationException("Error calling DLL " + path + "), Error Code: " + returnCode.ToString())
Line 48: End If
Line 49: Return New DirectoryInfo(path)

Behrouz_Rad
یک شنبه 12 شهریور 1385, 15:25 عصر
لینکی که دادم به اندازه ی کافی گویا هست.

saniak_robot
یک شنبه 12 شهریور 1385, 15:25 عصر
بهروز جان ، ما منتظریما

Behrouz_Rad
یک شنبه 12 شهریور 1385, 15:42 عصر
به جای "msvcrt.dll"، عبارت "kernel32.dll" رو بگذار!
این رو بدون که تضمینی برای اجرا وجود نداره. ممکنه اجازه ی اجرای دستورات از طریق فایل های API رو نداشته باشی و یا اجازه ی اجرای "Unmanaged Code" رو نیز!

موفق باشی.