Dailymotion上传VB.NET [英] Dailymotion upload VB.NET
问题描述
我是初学者.net
我尝试https://github.com/cbenard/SODailyMotionUpload我转换Vb.net在控制台上工作得很好。但我希望在Windows窗体项目中转换它。我想上传点击上传按钮等。我删除了console.writeline代码,但是在这个代码时给出错误
client.UploadFile(uploadUrl,fileToUpload)
给出错误=请求已取消
如何在表单项目中使用此代码。有什么想法吗?
我尝试了什么:
我转换c#代码到vb.net
在我的项目中合并但是给出错误
I am beginner .net
I try https://github.com/cbenard/SODailyMotionUpload I convert Vb.net Work good on console. but I want convert this on windows form project. I want upload with click upload button etc. I delete console.writeline codes but give error when come this code
client.UploadFile(uploadUrl, fileToUpload)
give error = request canceled
how to use this code in form project. any idea?
What I have tried:
I convert c# codes to vb.net
Combine in my project but give error
推荐答案
Windows窗体与控制台应用程序非常不同:你运行一个控制台应用程序,你可以控制在什么时候发生的事情,并在你想要的时候要求用户提供输入。
Windows应用程序以完全不同的方式工作 - 它们会对因为用户做某事而发生的事件做出反应,或系统中发生的事情
只是删除控制台读取和写入指令不会使它成为Windows应用程序,可能是您的问题的主要来源。当您从用户读取内容时,您阻止了在后台发生的进程(通过Process.Start),例如在代码继续之前完成。
您不能只使用C#控制台代码,将其转换为VB,删除用户I / O,并期望它作为适当的Windows应用程序工作。您需要坐下来准确理解原始文件的作用及其工作原理,然后基于此设计一个全新的Windows应用程序。我们不能为你工作!
Windows forms is very, very different from a console app: when you run a console app you control what happens when, and demand input from the user when you want it.
Windows apps work in a totally different way - they react to event that occur because the user did something, or something happened in the system
Just removing Console read and write instructions doesn't make it a windows application, and is likely the main source of your problem. When you took out the read-from-the-user stuff, you prevented processes that were occuring in the background (via Process.Start) for example from completing before your code continued.
You can't just take C# console code, translate it to VB, rip out the user I/O, and expect it to work as a "proper" windows app. You need to sit down and understand exactly what the original is doing, and how it works, then design a completely new windows application based on that. And we can't do your work for you!
了解配偶。我不希望任何人给我写代码。
我只想知道如何处理任何方法名称或任何策略?
Understand mate. I dont want anybody write me code.
I only want how to way any method name or any tactic?
这篇关于Dailymotion上传VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!