Open image saved in database with Internet explorer - c#

How I can open the image saved in database directly using Internet Explorer (Not WebBrowser control in WinForm/WPF) without saving it to a file first?

I think this is not possible unless you create a web page or something similar to display the image from a temp file

Search for Process.Start look at the site...
MSDN
This gives you the exact example of opening a file in IE, you might need to save your image into a temp file on the disk

Related

Open a bitmap using default photo viewer without saving file

I have a WinForms app that takes a screenshot, and I want to be able to view this screenshot. Originally I was creating a new instance of a PreviewForm which contained nothing but a picturebox, but if the image being previewed was large, the screenshot is kind of useless.
I'm aware of defining a filepath and using Process.Start(), but this would require this screenshot being saved locally before opening.
Is there no equivalent method to open an image in image viewer from just a bitmap object?
I find it would be easier if you just saved it and opened it with a software. I tried to find many different ways to not save the file, but there aren't any unfortunately, so I have to save it and open with a tool like this: http://www.paintshoppro.com/en/pages/bmp-file/

Process Start to open image file in resources folder

I have a C# program that I need to embed an image into or perhaps better stated make the exe file portable such that the image will open on any computer and I need the image to open up in the default picture viewer (not a form PictureBox). I do have the image in the resource folder with 'Embed Resource'
System.Diagnostics.Process.Start = WindowsFormsApplication5.Properties.Resources.MyImage;
I realize the above code is invalid, but I am just a coding hobbyist, so I don't know everything. If I could get a little push in the right direction, I would appreciate it.
This might do the trick for you but If you want a Default Image Viewer to open a picture, you need to store that image to somewhere on your disk, thus the Image Viewer could find and open your picture.
var bitmap = new Bitmap(WindowsFormsApplication5.Properties.Resources.MyImage);
bitmap.Save("YourImageLocation");
Process.Start("YourIamgeLocation");

C# to upload the file in project directory

I am using c# to save info in MS Access DB,And the form is using file upload control.And I could like to save the attached document of file control in specvific folder of the project.Can any one help me how can I do it.
FieUpload.SaveAs function is the one you looking for.
FileUpload1.SaveAs(savePath);
Also, check Environment.SpecialFolder library to find a suitable default folder as you like.

Upload file to server that is open

So I'm using WebClient to upload a file to a server. It works great except for one problem. If the file is opened by another program then it will not upload. For instance, if it's a word document that's been saved but is still opened by word then it fails to upload. Is there a way to force it to read whatever is there and upload it?
If i understand your question right then you can use this solution to test if the file is open and then close it if it is. It's a useful helper class i've used in the past.
https://stackoverflow.com/a/1247326/4612655

C# open file from physical path

sorry for asking a silly question it seems to be,
I am new to programming and trying to write a asp .net web application.
One part of the application had generated and saved some document
(like pdf, excel, words, gif, jpg, etc.) to a physical path in server side,
User can choose to download the file by clicking a button
is there something like "window.open(url)" that can raise a file download dialog box with known document type in javascript / c#?
Thanks a lot!!

Categories