|
Can you please reply with the code ... I have similar problem ...
Thanks in advance.
Regards,
KK
|
|
|
|
|
Hi,
I am trying to listen my system in port number 399, but some times it is accessed by some other process. How can i select another free port automatically?
Thankyou,
YP
|
|
|
|
|
Read this Port numbers[^].
Choose something in the range of 49152–65535
|
|
|
|
|
In this case the generally we use a try catch block
The prototype is
Try
{
//Here try to Listen at a prot number
}
Catch (//For port already in use expection)
{
PortNumber = portNumber ++ ;
//Again try to connect but to new port number
}
Continue this till we find a free port , or till you think its enough of trying (Throw an message to user , no port available to listen)
Also make sure that the socket connecting to this kind listener also need to try different ports , because it does not know , which port was free for the listener.
I hope this provides some clue , feel free to ask , if you have doubts
-Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
Hi,
I have written a basic UserControl (called bevel). On it I have a Label and nothing else. I can successfully add this to a form and it does what it should.
From various web examples, I added code to add a 'verb' to the design time context menu. The resulting file looks like...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel.Design;
namespace MyNameSpace.Components
{
[Designer(typeof(BevelDesigner))]
public partial class Bevel : UserControl
{
public Bevel()
{
InitializeComponent();
}
}
internal class BevelDesigner : ComponentDesigner
{
public override System.ComponentModel.Design.DesignerVerbCollection Verbs
{
get
{
DesignerVerbCollection v = new DesignerVerbCollection();
v.Add(new DesignerVerb("Flip", new EventHandler(FllipHandler)));
return v;
}
}
private void FllipHandler(object sender, System.EventArgs e)
{
}
}
}
Trouble is now the component does not display on the design form any more but rather sits at the bottom rather like the 'Timer' component does. When I right click on the component, the verb "Flip" has been added, however. I was wondering if it was somehow bypassing the "Bevel.Designer.cs" form and if so what I could do about it. I was also wondering if the above example was for 'raw' code and was incompatible with a project done in an IDE. I am using Visual Studio 2008 should that makes any difference. I figure I am missing something really basic as every example has a variation of the above example without any further elaboration.
Regards,
David Bailey.
|
|
|
|
|
You appear to be inheriting from the ComponentDesigner class; perhaps the System.Windows.Form.Design.ControlDesigner class may be more suitable?
|
|
|
|
|
Hi Computafreak,
Thanks for pointing that out. Tried it and you were spot on.
- David Bailey
|
|
|
|
|
i am adding one custom property to textbox.when i click on this item i need to show one form (like popup window).and this form having one textbox and one button..after entering the text in textbox and click on ok button.i need to display the text in this custom property item..
please any one help me.
|
|
|
|
|
How do you add the custom property to textbox? Do you mean inherite from textbox control? If so, just register the click event of OK button from the custom control. Then you write the code to update the property.
I Love KongFu~
|
|
|
|
|
i am adding one custom property to textbox.when i click on this item i need to show one form (like popup window).and this form having one textbox and one button..after entering the text in textbox and click on ok button.i need to display the text in this custom property item..
please any one help me.
|
|
|
|
|
hello
i have an assignment (don't run!) about a computer vision system for a robot.
My team and i are stuck on it, because this is the very first time in our lives we use c# (please, don't run!. We do have basic programming knowledge, tho, so we are not totally lost. The point is we need to manage the webcam images data in a list of list; we know it's possible to do this but we are not so sure of how.
List<PixelData> Shape = new List<PixelData>();
List<List<PixelData>> ShapeList = new List<List<PixelData>>();
ShapeList.Add(Shape);
Shape = ShapeList.IndexOf(List<PixelData>, 2);
(we are testing code, that's why it might not seem to make sense.)
as we track down a binary bitmap, we need to identify shapes and we will never know how many shapes are we going to find on each bitmap; so, as a start, we want the list of shapes, but each shape is actually a list of the pixels that build it up... (am i clear?)
the questions:
gt;do we need to give a name to every list of datapixels inside the mayor list? how do we do that?
gt;how do we retrieve each shape (list of datapixels from the main list) as a whole and then each shape data (datapixels from every list)?
gt;... does the little bit of code makes any sense at all ?
please please help.
tnx
atte: my classteam and i
VB
|
|
|
|
|
VitroBlue wrote: do we need to give a name to every list of datapixels inside the mayor list? how do we do that?
No., If you want to name them, use a hashtable. As it stands, you address them by index in the array. foreach(List<PixelData> list in ShapeList) or ShapeList[0]
VitroBlue wrote: how do we retrieve each shape (list of datapixels from the main list) as a whole and then each shape data (datapixels from every list)?
Foreach at each level. Top level to get the lists, foreach on each list to get each pixeldata object.
VitroBlue wrote: does the little bit of code makes any sense at all
Yes, all of it bar the last line. To find an index, you need the object whose index you are searching for, so that just plain won't work at all.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
if PixelData is a class representing one pixel, are you aware of the fact that this will lead to:
- a huge waste of memory: an object typically has 32 bytes of overhead, so say you are holding 4 bytes of useful information, it will take 36 bytes of memory
- a very slow execution: just enumerating the pixels will take forever, due to a number of indirections in your setup.
IMO the normal approach to this would be:
- either store image information in arrays, say red[], green[], blue[] for the color components of all pixels in the image, or at least in the scanline;
- or use existing classes, such as Bitmap (which internally stores pixel data in an array of structs, each struct holding one byte or red, green, blue, alpha). An array of struct seems most appropriate, since now you can use pointers and don't use unnecessary extra indirections.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 9:09 AM
|
|
|
|
|
Hi,
iam developing windows application using c#..
iam Exporting Datagridview data to Excel file it's working properly..
but in one system exporting function is working only one time,if i restart the
system and again it's working for one time..
what's the problem,can anybody please help me ..
but iam running the sample application in another system,there exporting function working N no:of times..(continuously working..)
Thanks in Advance...
murali krishna
|
|
|
|
|
On what basis did you post this ? You surely don't expect help based on this ? How about seeing some code ? How about telling us what's different about that machine that fails ? How about telling us the error message ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
As Chris said, there are no adequate information in your post.
A little more info would be more helpful.
However check these things.
1. Are you connecting to any shared drives or subst drives which is required by your application. If so are those drives getting mapped once again when the system is restarted.
2. Are you trying to update the same file. If so are you handing this in your code to delete and create the file again or some sort of this.
If these are not feasible to you, we are expecting more info from you regarding the problem.
|
|
|
|
|
Hi all, I need help
I have a IE toolbar menu button: Generate
My flow is
After i click the Generate button, the link on my current website will appear in a:
Form1 > textBoxWebPageURL
Form the Form1.Designer.cs
this.textBoxWebPageURL.Location = new System.Drawing.Point(238, 13);
this.textBoxWebPageURL.Name = "textBoxWebPageURL";
this.textBoxWebPageURL.Size = new System.Drawing.Size(328, 20);
this.textBoxWebPageURL.TabIndex = 5;
this.textBoxWebPageURL.Text = "http://www.codeproject.com"; <-- Whereby i have to hardcode it
How do i make it auto capture the current website that i am browsing and the textbox will display the current website ?
Thank You
|
|
|
|
|
Notsure what you mean by 'the current website I am browsing' - does your form have a WebBrowser control on it? Or are you talking about an independent browser?
If the former, does not the Url property hold the Url of the current page?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
The flow is like this
i click on a button <<Generate>> , the last website that i am browsing will appear in my textbox
<< for example i am visiting http://www.codeproject.com >>
I want it to be appear in the textbox after i click << Generate >>
So how can i do it?
Thank you
|
|
|
|
|
You didn't answer his question. I assumed you meant that your code is running inside IE, and you want te currently visible page. Either way, you need to answer if you want help.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
yes
is like read current active IE window's html content
and it will appear into a textbox
Thank You
|
|
|
|
|
I'm almost certain it's not impossible.
I am certain it is complex (especially if you take into account it could not be IE, there could be multiple IE windows or tabs, it could be firefox, chrome etc.)
You could try this page[^]
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
Thank You
Cause i am doing about
encrypt of html - pdf
So i need to know how to capture the current website to a textbox
thank You
|
|
|
|
|
Hi,
n00b style question time... In my form's CancelButton property, I've set it to btnCancel, which is a button on my form, of course.
In the implementation, if I detect changes, I prompt the user if they're sure about discarding changes, and if they say no, the idea is to leave the form open.
Even though I'm not calling Close(), the form still closes anyway, probably as a result of it being associated w/ the CancelButton property. How can I cancel this behavior so that the screen remains open if they don't want to discard changes?
my btnCancel_Click(..) func is implemented like so:
private void btnCancel_Click(object sender, EventArgs e)
{
if( HasChanges() )
{
if( Yes == MgBox: "You sure 'bout that?") )
this.Close();
else
return;
}
else
this.Close();
}
Thanks!
|
|
|
|
|
CancelButton is for Escape Key, mean whenever you press Escape key that button's click event will called. Even you have focus on other control. Same like AcceptButton property that works on Enter key
for your problem, you should use FormClosing event. Set e.Cancel = true; if you want to form keep open.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
modified on Thursday, March 5, 2009 9:13 PM
|
|
|
|