|
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.
|
|
|
|
|
|
I'm trying to make a group settings classes that read XML files and set the appropriate fields in those classes. Here are the classes I have:
SettingsBase
System1Settings : SettingsBase
System2Settings : SettingsBase
...
I also have some sub classes that grouped common settings together for easier coding.
class System1Macros
{
string macro1;
string macro2;
...
}
class System1Registers
{
string register1;
string register2;
...
}
Inside each system class, I have some fields that inherit from those classes. For example, inside System1Settings:
System1Macros macros;
System1Registers registers;
My settings.xml files have the format:
<?xml version="1.0" encoding="utf-8" ?>
<System1Settings>
<Setting name="SomeSetting1">Major1</Setting>
<Setting name="SomeSetting2">Major2</Setting>
<Setting name="SomeSetting3">Major3</Setting>
...
<Macros>
<Setting name="Macro1">1</Setting>
<Setting name="Macro2">10</Setting>
...
</Macros>
<Registers>
<Setting name="Register1">1</Setting>
<Setting name="Register2">2</Setting>
...
</Registers>
</System1Settings>
What I want to do is read in the System1Settings.xml file and set all of fields in System1Settings (the values in the first level of the xml file) and the fields in the specialized classes to the other levels of the xml file. So:
System1Settings.setting1 = SomeSetting1
System1Settings.setting2 = SomeSetting2
...
System1Settings.macros.macro1 = Macro1
System1Settings.macros.macro2 = Macro2
...
System1Settings.registers.register1 = Register1
System1Settings.registers.register2 = Register2
...
Right now I'm trying to use reflection in the SettingsBase (thinking I could write this routine once for all child classes and not have to rewrite each time I make a new settings class), but I'm not sure how to drill down through the fields in the SystemSettings classes to know which fields in the child classes are subclasses that need to be set. I thought there was a way to serialize/deserialize the XML, but I don't know that I can use the class structure I have.
Any insights, critiques, or nudge/shove/push/kick in the right direction would be appreciated.
Thank you,
Brad
Deja Moo - When you feel like you've heard the same bull before.
|
|
|
|
|
This doesn't seem like a good use of Reflection and I hope you don't usually resort to Reflection so readily.
Why not pass the section of XML to a method of the class so it can set its own fields?
Or, rather than have the macros and registers as fields of the class, make a more dynamic structure that you populate from the XML?
|
|
|
|
|
Hi,
I have creating shared add-in in C# and then am then using Shim on top of it.
Shared add-in has some user defined functins.once you type the UDFs in Excel, it will log in to server using username and password,creates sessions and get the data.
I am planning to move VSTO. Is it possible to introduce VSTO instead of Shim on top of shared add-in?
how can I do it? can any one share the thoughts?
|
|
|
|