|
amir19 wrote: I don't want to use FileWebRequest
Good because FileWebRequest is not appropriate in this context anyway. Use WebRequest.
only two letters away from being an asset
|
|
|
|
|
I used FileWebRequest and WebRequest. But i want to get images from WebBrowser. I want to get image from the session that user is working with. Images are dynamic for users.
|
|
|
|
|
Please explain more about your application and what you are trying to accomplish
only two letters away from being an asset
|
|
|
|
|
I'm creating a website and an application for that. I want to my users use website in a windows app. I created an invisible webbrowser and i send login data from it. When i want to download user's image and other images from site, my site can't recognize user. I want to use images in webbrowser in picturebox or download them with session of webbrowser and then show them.
|
|
|
|
|
amir19 wrote: I created an invisible webbrowser
amir19 wrote: I want to use images in webbrowser in picturebox
What's the point of this? You can't simply just display the WebBrowser? Can they access the site without your application? If so, why would they use your app?
only two letters away from being an asset
|
|
|
|
|
I want my users use my site offline too with downloaded data and search in them.
|
|
|
|
|
amir19 wrote: offline
If they are offline how do you intend to authenticate and access the webpage to get the images
I think you're confused and should stop and think a bit.
only two letters away from being an asset
|
|
|
|
|
1) c# WebClient Object, you can download the image by it.
2) of course, you can copy the image to Clipboard by webBrowser, it's not very good way.
IHTMLDocument2 doc = (IHTMLDocument2)ie.Document.DomDocument;
IHTMLControlRange imgRange;
HTMLBody body = (HTMLBody)doc.body;
Bitmap bmp = null;
foreach (IHTMLImgElement img in doc.images)
{
if (img.src.IndexOf("someinfo") > 0)
{
imgRange = (IHTMLControlRange)body.createControlRange();
imgRange.add((IHTMLControlElement)img);
imgRange.execCommand("Copy", false, null);
bmp = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
}
}
if (null != bmp)
{
//deal with the Image
}
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:03pm.
|
|
|
|
|
I have a multi line text box, wordwrap set to true. No matter what character sequences I place at the end of each line using a hex text editor to build a text file, the text still streams when I loaded the .txt file into the text box. I have tried all combinations of trailing x'0D' x'0A'
Any ideas?
Thanks,
David
pongfar@comcast.net
|
|
|
|
|
Why are you using a hex editor? Notepad, WordPad or Word will all produce correctly formatted text files with newline sequences in the proper place.
faltopar wrote: the text still streams when I loaded the .txt file into the text box.
I'm not sure what you mean by this statement, can you explain?
|
|
|
|
|
i don't understand your mean clearly.
1)
you should use 'streamwriter' to save to file, 'streamReader' to read from file
, use(Utf-8) Encode.
2)
may be you should consider to change to right ''Hex,Octal,Binary。。。。“ before show to 'multi line text box',
after you read form file.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 22:03pm.
|
|
|
|
|
I have a C# application which uses a COM dll that was registered when some third party software was installed. So when I added a reference to it in visual studio, it naturally created an Interop.dll, and that's what I have a reference to.
My problem is that I wanted to send the program to a friend and he doesn't have that 3rd party software on his machine.
What's the best way to deal with this? I tried adding a reference to the dll file itself instead of using the COM tab, and that seemed to work, but it looks like it involves the path to that file on MY machine, which probably won't work on his side either. Copy Local is set to TRUE, but that seems to just copy in the Interop dll. I've had experience with a setup installer packaging the needed files and registering them for you, but i'd like to avoid an installer. we'll be doing rapid dev-test cycles and it's nice to be able to just 'drop-install' the files on his machine.
Anyone able to guide me on this?
|
|
|
|
|
If you send him the com dll just get him to open a cmd prompt and run regsvr32 <path_to_com_dll> .
|
|
|
|
|
Yeah, was hoping to avoid that, but it's my fallback plan.
Is that regsrvr32 file part of the visual studio SDK, or the windows SDK? And is it freely available? because i imagine i'll have to get him that as well.
|
|
|
|
|
Neither, its part of Windows.
|
|
|
|
|
Im not confirm that the regsvr32 is perfect for a dll registration which is developed by using C#.net..RegAsm command can be consider...
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
Thanks
Md. Marufuzzaman
|
|
|
|
|
Its a COM dll, not a .NET assembly.
RegAsm allows com clients to call .NET dll's. The OP was asking about accessing a COM dll from .NET
|
|
|
|
|
Apart from all the good advice from others, there is one point that you might want to consider.
That is the legality of copying the dll to your friends machine. If it came with software that you have installed, then there might be copyright issues. I'm not saying don't do it, I'm just saying is all.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I need to insert an image into a byte [] array Anybody know how to do this?
|
|
|
|
|
Message Closed
modified 23-Nov-14 10:07am.
|
|
|
|
|
Image img = Image.FromFile("FileAddress");
System.Io.MemoryStream mem=new System.Io.MemoryStream();
img.Save(mem, System.Drawing.Imaging.ImageFormat.Bmp);
byte[] b = mem.GetBuffer();
|
|
|
|
|
hi
I want to make a program. It has an output exe file. Is it possible
writing with c#.net?
why not!?
|
|
|
|
|
If you're asking whether or not you can run your program as an executable, then you can. Right click on your project and select Properties. Choose the Application tab, and select the Output type to be Windows Application or Console Application depending on which type you intend to deploy.
If you're asking whether or not you can create an executable from your program, then you can do this as well. You need to read up on the CodeDOM[^] classes.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
I mean ,I can create an executable from my program.
|
|
|
|
|
why not ??
if you set application type to ConsoleApplication / WindowsApplication, then the output is EXE.
|
|
|
|