|
A textbox is not meant to display "binary" code, and HEX-codes as your other post suggests are not a form of binary. There's quite some examples on how to convert a byte to hex in C#, but if you want the data in a nice transmittable form, you'd be better of converting it to Base64.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Define "result:" exactly what type of information do you want to display in the TextBox ?
Don't use ArrayList: it's an older data structure that uses a lot of memory: use an array.
Study these links and code:
public static byte[] ImageToByteAry(Image image, ImageFormat format)
{
var stream = new System.IO.MemoryStream();
image.Save(stream, format);
stream.Position = 0;
return stream.ToArray();
}
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I have this home project... at home.
It has lots of project.
I am also using Nuget to get some 3rd party library.
One of this Nuget package in particular contains 6 DLLs.
It is used in 4 projects... (a bit messy to update)
Now one of this DLLs has a nasty bug. Fortunately the source is on Github!
Is there an easy way for me to debug this single DLL with my project? Without having to mess up with my Nuget packages?
|
|
|
|
|
If you can download the source from Github you can reference the project directly - it may all fall apart if the other 5 DLLs are referencing (never had to attempt that) it internaly.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Oh.. it turns out I can remove the DLL reference without removing the Nuget package!
After that I can reference the project and Bob is your uncle!
Well.. just gonna continue testing my app until I meet this error again, sweet, thanks!
|
|
|
|
|
so basically I want my 3rd party program (which will be created using c# on WPF) be an interface between the user and that site. Using WebBrowser class I wanna load the login page and after the user logged in(and passed CAPTCHA), he/she will fill some fields in the program, and the program will use those data to fill the website fields.
after the user logged in to that website how can my program use his/her cookies to be able to access his/her profile to fill its fields?
|
|
|
|
|
It's quite possible that you can't - the info doesn't have to be stored in cookies, it can be stored in the Session which is entirely server based.
And even if you can, I'm not sure it's something we should be involved in: sites add CAPTCHA to prevent apps from accessing an entire site and / or submitting data automatically, and what you are asking is effectively bypassing that.
If you have a genuine need, then contact the site admins and ask them: they may give you a simple method (or tell you to go to hell).
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Can anyone help me understand this. not too much luck finding anything in google?
using the following code to display a image in a button works fine
button1.Image = global::AppInfo.Properties.Resources.MyImage;
But if I trying to display the image on a windows Form listbox, it does not work
listBox3.Items.Add(global::AppInfo.Properties.Resources.MyImage);
This only displays "System.Drawing.Bitmap" text
many thanks in advanced
|
|
|
|
|
|
If you add it to a listbox as an item, it will try to find a string-representation of your object. The thing it is displaying means it is working, and correctly. If you want images TO the items, try the Listbox.ImageList . There's an example on MSDN.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You may get more helpful replies here if you describe what the bitmaps you want to display are ... are they icons; do they vary in size, etc. ?
Start here: [^] and figure out:
1. would using a ListView or DatagridView be a better choice
... if not ...
2. would the facility to use an 'ImageList with the ListView do what you want
... if not ...
3. are you willing to take on drawing the graphics yourself ... sub-classing the ListView and owner-drawing ... see: [^]
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I have an event right:
private void dataGridView1_SelectionChanged (object sender, EventArgs e)
{
}
I would like to trigger an event when it is made:
private void dataGridView1_RowContextMenuStripNeeded (object sender, DataGridViewRowContextMenuStripNeededEventArgs e)
{
}
Simply that the RowContex event worked with SelectionChanged ...
I searched the Internet and these mean me on average: |
If you can, it can be an example of how to do it?
|
|
|
|
|
It's not a good idea, or even really necessary.
Instead of messing about trying to force events to occur, put the code in your event handler inside a separate method and call it from both locations. That way, you don't need to "force" events to happen (which is rarely a good idea) and you reduce the code in your event handler which is a good idea from a style POV.
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
it can not be otherwise. I created a dynamic DGV fill and it does not support the RowContextMenuStripNeeded event and the SelectionChanged event as much as possible. I also wanted calling the SelectionChanged event to involve calling the RowContextMenuStripNeeded event. So how to do it? except that it is not a good idea, etc.
|
|
|
|
|
Sure.
private void DoWork()
{
}
private void dataGridView1_SelectionChanged (object sender, EventArgs e)
{
DoWork();
}
private void dataGridView1_RowContextMenuStripNeeded (object sender, DataGridViewRowContextMenuStripNeededEventArgs e)
{
DoWork();
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I tried it. But if I do as you write, this is the exception:
private void dataGridView1_RowContextMenuStripNeeded (object sender, DataGridViewRowContextMenuStripNeededEventArgs e)
{
e.ContextMenuStrip = contextMenuStrip1; <--- here: The object reference has not been set to the instance of the object
selectedrowindex = e.RowIndex;
}
Can you do something about it?
I also tried this:
private void dataGridView1_SelectionChanged (object sender, EventArgs e, DataGridViewRowContextMenuStripNeededEventArgs ee)
{
dataGridView1_RowContextMenuStripNeeded (sender, ee);
}
it can not be so ... because there is a mistake:
CS0123 error None of the overloads for the "dataGridView1_SelectionChanged" element match the "EventHandler" delegate.
Regarding the code from the deasinger:
this.dataGridView1.SelectionChanged + = new System.EventHandler (this.dataGridView1_SelectionChanged);
how to make it fit?
|
|
|
|
|
Member 10975497 wrote: how to make it fit? The e.ContextMenuStrip will be null if you call it by hand. It is set in code by the DGV that is calling the event. If you call it, you either must create your own DataGridViewRowContextMenuStripNeededEventArgs and fill it with the correct data, or find another way to determine which context-menu strip is meant.
Member 10975497 wrote: I also tried this: That's not allowed, since both events have different signatures.
Try adding the menustrip-thing as a parameter in the DoWork method
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Trying the menustrip-thing as a parameter in the DoWork method Smile | :)
Could you show me how? Programming is not my strong side
|
|
|
|
|
private ContextMenuStrip contextMenuStrip1;
public Form1()
{
InitializeComponent();
dataGridView1.RowContextMenuStripNeeded += dataGridView1_RowContextMenuStripNeeded;
dataGridView1.SelectionChanged += dataGridView1_SelectionChanged;
contextMenuStrip1 = new ContextMenuStrip();
contextMenuStrip1.Items.Add("The turtle moves.");
}
void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
DoMyBidding(null);
}
void dataGridView1_RowContextMenuStripNeeded(object sender, DataGridViewRowContextMenuStripNeededEventArgs e)
{
e.ContextMenuStrip = contextMenuStrip1;
int selectedrowindex = e.RowIndex;
DoMyBidding(e.ContextMenuStrip);
}
void DoMyBidding(ContextMenuStrip humbly)
{
}
This is what Griff was explaining in sorts, before you stated it cannot be otherwise
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Thanks
|
|
|
|
|
You're welcome
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Please, anyone, help to make this?
Give me the source code of this project.
|
|
|
|
|
Member 14089822 wrote: Give me the source code of this project. Give me, oh let's say, £400,000 and I'll do it.
This space for rent
|
|
|
|
|
Member 14089822 wrote: Give me the source code of this project.
No. "Help to make project" is one thing, "source code of this project" is another altogether.
Two reasons:
1) We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, or learn the Magic Words: "Do you want fries with that?"
If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
2) You do realise that your tutor is almost certainly well aware of this site - and others - and will detect very quickly that what you handed in was not your own work? Indeed, I know of several teachers who are regular visitors here ...
And there is a technical term for "handing something in when you didn't write it" - it's called "plagiarism".
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi,
that is easy, just ask for a copy of your friend's home work[^] and adjust the wordings of the form titles and labels.
|
|
|
|