c#--如何在 webBrowser 的 html 元素中设置图片

c#--how to set a pic in html element in webBrowser

<input type="file" name="media empty"  multiple=""  data-original-title="Add photos or video" data-delay="150"> 

我想在网络浏览器中将图片上传到网页,但我真的不知道如何使用 C# 做到这一点 我的意思是我想用 c# 将图片上传到网站,该网站已加载到我的网络浏览器中

据我了解,您希望在将图片上传到您的网页后立即看到它。试试这个:

 <div class="form-group">
            <label for="Photo">Photo</label>
            <input type="file"
                   id="Photo"
                   name="Photo"
                   onchange="show(this)" />
        </div>

<img id="onLoad"
             src="#"
             alt="qwerty">

<script>
function show(input) {
    if (input.files && input.files[0]) {
        var reader = new FileReader();

        reader.onload = function (e) {
            $('#onLoad')
                .attr('src', e.target.result);
        };

        reader.readAsDataURL(input.files[0]);
    }
}
</script>