Ошибка исключение во время запроса webclient

So, I have built an auto update program to my program.

The code that is running in here is:

new WebClient().DownloadFile("XXXX", checkingfolder.SelectedPath);

the XXX is my webserver that is running as a VPS server in verio, with the newest IIS and everything.

When the user clicks on the download button, it says:

'An exception occurred during a WebClient request.

The thing is, that I dont even know why — i am just doing try catch.

Anyone here have any idea why this happened?

Thanks for any help you will give me, you have no idea how much you are helping me here — thanks again !

08.11.2015, 20:24. Показов 3358. Ответов 1

Здравствуйте, уважаемые программисты! Не могли бы вы мне помочь?

У меня возникла ошибка в на следующем моменте кода, или, как сказало Visual Studio, исключение во время запроса WebClient:

VB.NET
1
My.Computer.Network.UploadFile("E:/text1.txt", "ftp://ftp.kaven.neolocation.net//text1.txt", "***", "***")

Вот сведения об исключении:
System.Net.WebException не обработано
HResult=-2146233079
Message=Исключение во время запроса WebClient.
Source=System
StackTrace:
в System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
в System.Net.WebClient.UploadFile(Uri address, String fileName)
в Microsoft.VisualBasic.MyServices.Internal.WebClien tCopy.UploadFile(String sourceFileName, Uri address)
в Microsoft.VisualBasic.Devices.Network.UploadFile(S tring sourceFileName, Uri address, ICredentials networkCredentials, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
в Microsoft.VisualBasic.Devices.Network.UploadFile(S tring sourceFileName, String address, String userName, String password, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
в Microsoft.VisualBasic.Devices.Network.UploadFile(S tring sourceFileName, String address, String userName, String password)
в WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e) в D:EducationПрограммыVisual StudioWindowsApplication1WindowsApplication1For m1.vb:строка 16
в System.Windows.Forms.Control.OnClick(EventArgs e)
в System.Windows.Forms.Button.OnClick(EventArgs e)
в System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
в System.Windows.Forms.Control.WndProc(Message& m)
в System.Windows.Forms.ButtonBase.WndProc(Message& m)
в System.Windows.Forms.Button.WndProc(Message& m)
в System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
в System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
в System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
в System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
в System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
в System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
в System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
в System.Windows.Forms.Application.Run(ApplicationCo ntext context)
в Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.OnRun()
в Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.DoApplicationModel()
в Microsoft.VisualBasic.ApplicationServices.WindowsF ormsApplicationBase.Run(String[] commandLine)
в WindowsApplication1.My.MyApplication.Main(String[] Args) в 17d14f5c-a337-4978-8281-53493378c1071.vb:строка 81
в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
в Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
в System.Threading.ThreadHelper.ThreadStart_Context( Object state)
в System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
в System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.IOException
HResult=-2147024864
Message=Процесс не может получить доступ к файлу «E:text1.txt», так как этот файл используется другим процессом.
Source=mscorlib
StackTrace:
в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
в System.Net.WebClient.OpenFileInternal(Boolean needsHeaderAndBoundary, String fileName, FileStream& fs, Byte[]& buffer, Byte[]& formHeaderBytes, Byte[]& boundaryBytes)
в System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
InnerException:

Как мне это исправить?
Заранее большое спасибо!

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

  • Remove From My Forums
  • Вопрос

  • Всем доброго дня! Помогите с проблемой

    $Url = "http://site/file.exe"
    $Path = "D:1.exe" 
    $WebClient = New-Object System.Net.WebClient
    $WebClient.DownloadFile($url,$path)

    при выполнении

    Исключение при вызове «DownloadFile» с «2» аргументами: «Исключение во время запроса WebClient.»
    строка:4 знак:1
    + $webclient.DownloadFile($fileURL,$fileName)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : WebException

    что не так? Help?

Ответы

  • Проверьте путь, указанный для сохранения файла. Попробуйте скачать файл в другое место.

    • Помечено в качестве ответа

      14 октября 2013 г. 9:37

08.11.2015, 20:24. Показов 3806. Ответов 1


Студворк — интернет-сервис помощи студентам

Здравствуйте, уважаемые программисты! Не могли бы вы мне помочь?

У меня возникла ошибка в на следующем моменте кода, или, как сказало Visual Studio, исключение во время запроса WebClient:

VB.NET
1
My.Computer.Network.UploadFile("E:/text1.txt", "ftp://ftp.kaven.neolocation.net//text1.txt", "***", "***")

Вот сведения об исключении:
System.Net.WebException не обработано
HResult=-2146233079
Message=Исключение во время запроса WebClient.
Source=System
StackTrace:
в System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
в System.Net.WebClient.UploadFile(Uri address, String fileName)
в Microsoft.VisualBasic.MyServices.Internal.WebClientCopy.UploadFile(String sourceFileName, Uri address)
в Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, Uri address, ICredentials networkCredentials, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
в Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, String address, String userName, String password, Boolean showUI, Int32 connectionTimeout, UICancelOption onUserCancel)
в Microsoft.VisualBasic.Devices.Network.UploadFile(String sourceFileName, String address, String userName, String password)
в WindowsApplication1.Form1.Button1_Click(Object sender, EventArgs e) в D:EducationПрограммыVisual StudioWindowsApplication1WindowsApplication1Form1.vb:строка 16
в System.Windows.Forms.Control.OnClick(EventArgs e)
в System.Windows.Forms.Button.OnClick(EventArgs e)
в System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
в System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
в System.Windows.Forms.Control.WndProc(Message& m)
в System.Windows.Forms.ButtonBase.WndProc(Message& m)
в System.Windows.Forms.Button.WndProc(Message& m)
в System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
в System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
в System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
в System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
в System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNat iveMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
в System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
в System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
в System.Windows.Forms.Application.Run(ApplicationContext context)
в Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
в Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicat ionModel()
в Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
в WindowsApplication1.My.MyApplication.Main(String[] Args) в 17d14f5c-a337-4978-8281-53493378c1071.vb:строка 81
в System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
в System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
в Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
в System.Threading.ThreadHelper.ThreadStart_Context(Object state)
в System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
в System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
в System.Threading.ThreadHelper.ThreadStart()
InnerException: System.IO.IOException
HResult=-2147024864
Message=Процесс не может получить доступ к файлу «E:text1.txt», так как этот файл используется другим процессом.
Source=mscorlib
StackTrace:
в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
в System.Net.WebClient.OpenFileInternal(Boolean needsHeaderAndBoundary, String fileName, FileStream& fs, Byte[]& buffer, Byte[]& formHeaderBytes, Byte[]& boundaryBytes)
в System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
InnerException:

Как мне это исправить?
Заранее большое спасибо!



0



Question

_RaFael_30

    • Share

4xAwqBAs6ZM.jpg

Link to comment
Share on other sites

Recommended Posts

  • 0

ImOllie

Newbie

    • Share

// Moved to Russian Help

Kind Regards,

Ollie

xMbPhG7.png

Link to comment
Share on other sites

Recommended Posts

  • 0

ImOllie

Newbie

    • Share

// Moved to Russian Help

Kind Regards,

Ollie

xMbPhG7.png

Link to comment
Share on other sites

  • 0

07.kbr

    • Share

Отключи антивирус и перекачай еще раз. Антивирус блокирует core_ets2mp.dll почему то. 

Link to comment
Share on other sites

  • 0

_RaFael_30

  • Author
    • Share

1 hour ago, 07.kbr said:

Отключи антивирус и перекачай еще раз. Антивирус блокирует core_ets2mp.dll почему то. 

Отключил антивирус и перекачал. Все заработало. Спасибо!

Link to comment
Share on other sites

  • 0

[ATL] VLAD (UA)

    • Share

Вопрос решен, тема закрыта.

Link to comment
Share on other sites


Guest

This topic is now closed to further replies.

Понравилась статья? Поделить с друзьями:
  • Ошибка к подключению существующему сеансу
  • Ошибка исключение в обработчике исключений
  • Ошибка источника мультимедиа код ошибки 2
  • Ошибка к подключению к серверу apple id на телефоне
  • Ошибка исключение unknown software exception 0xc80000003