So, How can I get correct port list (without com3)?
You can give System.Management a try, I have used it before to enumerate hardware. I don't know for sure whether virtual com-ports are included, and I can't test it on my own machine (at least not without installing a new com-port). You'd need to add a reference to the assembly "System.Management" to use this functionality. The code would be something like this;
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("SELECT Name FROM Win32_SerialPort");
foreach (ManagementObject mo in searcher.Get())
Alternatively, you could scan the registry. Open RegEdit and search for the friendly name of the COM-port
I am not able to execute oracle stored procedure in C# code.
requirement: execute oracle stored procedure which has 1 inout parameter in C#. and inout parameter type is string/varchar.
input: i am having a oracle stored procedure which had one INOUT parameter.
exception getting: when i am using below lines of code
OracleConnection con = new OracleConnection(StrConnectionString);
OracleCommand cmd = new OracleCommand("sapncdb.encrypt_field", con);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter inval = new OracleParameter("inval", OracleType.VarChar);
inval.Direction = ParameterDirection.InputOutput;
inval.Value = "13-4186423 ";
Response.Write("return value is "+ inval.Value);
i am getting invalid procedure exception. i am not able to find where the problem is..
if the above code is wrong, you please provide me correct way of fulfilling my requirement.
Yup, that looks good using the intersection of the two rectangles. The right and bottom line are probably not appearing because they're outside the clip rectangle. The Rectangle method draws a rectangle where the dimensions you supply are the area inside and not including the lines.
Try deflate()ing the rectangle a bit and you should see all four sides.
I think the cause is the graphics,which belong to panel1(the parent of groupbox1),we drawed the rectangle on the panel1 but it just under the groupbox1.So the rectangle we drawed were cover by the groupbox1.
I'm not sure I like the look of this. You appear to be painting on the groupbox in the paint event of the form. Really you should only use that to paint areas of the form that don't have controls on them. You'd need to do that paint in the groupbox's paint event, not the form one.
Likelyhood is that the groupbox paints itself immediately after the form. Do you get flicker at all?
I want to ask a question about GUI designing in C#
I have a project to do , and it has only a few forms to show
and it is very important to have a very special and also very beautiful GUI
I want to know is it better to have a GDI+ and/or have a System.Drawing or/and
it is better to have a custom Control
help me please
thank you all
...f is a Form
for (int i = 0; i < f.Controls.Count; i++)
t_ctrl = f.Controls[i];
TreeNode t_tn = new TreeNode(string.IsNullOrEmpty(t_ctrl.Text) ? t_ctrl.Name : t_ctrl.Text);
t_tn.Tag = t_ctrl;
private static void addNode(Control ctrl, TreeNode tn)
for (int i = 0; i < ctrl.Controls.Count; i++)
t_ctrl = ctrl.Controls[i];