|
ProcessStartInfo supports limited options on the opened window: hiden, minimized, maximized, normal. Other window styles have to go through the client program, "iexplore", for example.
Best,
Jun
|
|
|
|
|
Hi,
Im trying to make a program to communicate with something that is connected with the serial port.
The device i wanna connect to the serial port knows several commands.
So basically there needs to be a simple connection with the port so that i can put commands in the console and the device reply's me and sets its output on the console.
So far i got this:
static SerialPort serialPort;
public static void Main()
{
serialPort = new SerialPort("COM1", 19200, Parity.None, 8, StopBits.One);
}
I hope someone could help me a bit.
Thanks in advance!
|
|
|
|
|
hello
Yustme wrote: I hope someone could help me a bit.
With what?? Where is your question?
Regards
|
|
|
|
|
Hello Devs,
I'm new to Compact Framework Programming. I'm porting a Chat application to Window Mobile. I noticed that whenever I create and oshow a new instance f Form, its shown as a seperate procees in Running Prgrams. 10 forms means 10 Processes in Running Programs .
To avoid this to happen, I thought to work with tab controls and adding a tab page to the tab control when a user initiates chat with a new person.
What I want is that I want to add and remove pages dynamically. For this when I tap and hold on the node of the tab page (equal to Right Click) a context menu should open "Close Tab" and Taping this menu item that specific Tabpage should be closed. I have tried to do it with Context Menu but It does appear when you tap and hold on the tab page, not its node
I have tried to be clear in telling my problem but even if you need some more clarity and info please ask me.
I really want to get a solution (Its so urgent)
I hope to get a positive response from you people.
Best Regards,
Rizwan
|
|
|
|
|
Hello
dotnetdev83 wrote: but It does appear when you tap and hold on the tab page, not its node
It depends on which event you handled. Either TabControl.MouseDown , or TabPage.MouseDown . In your case you probably consumed TabPage's not the TabControl's event.
Handle TabControl.MouseDown event and check TabControl.SelectedIndex
Regards
|
|
|
|
|
Quite simply, i can't find out how to add them.
All i know is, well, nothing really, i have a treeview, and it has nodes in it, and there are no pictures.
...
|
|
|
|
|
Hello
1- Make an ImageList
2- Add images to it using ImageList.Images.Add() method
3- Change the Treeview.ImageList to the above ImageList
4- Change the TreeView.ImageIndex to the index of the default icon
5- Change the Treenode.ImageIndex property of each node
Regards
|
|
|
|
|
Example
Search in database
using DataGite
using change colum name listview in thai
lmjojopjkopkop
|
|
|
|
|
Sit down and think. The take a look at what VS has on offer, if it's too difficult to use wizards and drag-and-drop to do this then learn something else.
If you actually want a functioning program give me a bell, my rates are £60 / hour.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Hi all,
Iam calling function in a loop, this function call is made by using reflections. User can able give a Loop count. if the user gives >2000 .net throws me the "out of memory exception"
What can i do to avoid it.
Can i use GC.Collect()?
at end of every iterations i nulled all the objects used. so it could have been collected by GC right?
I saw my app.performance in CLR profiler it shows Heap is Ok. but stack overflows with >85Mb. also there are more than 7000 unhandled handles in stack! what does it mean?
Please suggest some solution
Thanks
Srini
|
|
|
|
|
Calling GC.Collect() by yourself doesn't help. The garbage collector will try everything it possibly can to get memory back before the OutOfMemoryException is thrown. You are also talking about stack problems, but if you did have stack problems you'd most likely get a StackOverflowException. That usually happens if you get stuck in a recursive loop. I'd say you really have to just scrutinize the code to find out where you're grabbing memory but not letting go.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
private void btnSave_Click(object sender, EventArgs e)
{
string Strconn = "Server = local; User ID = sa; Password = computer; Initial Catalog = FingerData";
string Strcomm = "INSERT INTO Employee VALUES(";
Strcomm += "'"+txtFinger.Text+",'";
Strcomm += "'"+txtPrename.Text+"','";
Strcomm += "'"+txtFname.Text+"','";
Strcomm += "'"+txtLname.Text + "','";
Strcomm += "'"+txtNname.Text + "','";
Strcomm += "'"+picEmp.Image + "',";
Strcomm += "'"+txtAge.Text + ",";
Strcomm += "'" + "CONVERT(DATETIME,'" + txtBirth.Text + "', 102),'";
Strcomm += "'"+txtAddress.Text + "','";
Strcomm += "'"+txtDepartment.Text + "',";
Strcomm += "'"+txtSalary.Text + ",'";
Strcomm += "'"+txtHtel.Text+ "','";
Strcomm += "'"+txtMtel.Text + "','";
Strcomm += "'"+txtEmail.Text+"','";
Strcomm += "'"+txtPassword.Text + "')";
SqlConnection SQLconn = new SqlConnection(Strconn);
SqlCommand SQLcomm = new SqlCommand(Strconn, SQLconn);
try
{
SQLconn.ConnectionString = Strcomm;
if (SQLconn.State == ConnectionState.Open)
{
SQLconn.Close();
}
SQLconn.Open();
SQLcomm.CommandType = CommandType.Text;
SQLcomm.CommandText = Strcomm;
SQLcomm.Connection = SQLconn;
SQLcomm.ExecuteNonQuery();
}
catch (Exception Error)
{
MessageBox.Show("ไม่สามารถเพิ่มข้อมูลได้เนื่องจาก !!!!! " + Error.Message, "ข้อผิดพลาด", MessageBoxButtons.OK);
}
}
lmjojopjkopkop
|
|
|
|
|
Did you actually read Guffa's reply?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
private void btnSave_Click(object sender, EventArgs e)
{
string Strconn = "Server = local; User ID = sa; Password = computer; Initial Catalog = FingerData";
string Strcomm = "INSERT INTO Employee VALUES(";
Strcomm += "'"+txtFinger.Text+",'";
Strcomm += "'"+txtPrename.Text+"','";
Strcomm += "'"+txtFname.Text+"','";
Strcomm += "'"+txtLname.Text + "','";
Strcomm += "'"+txtNname.Text + "','";
Strcomm += "'"+picEmp.Image + "',";
Strcomm += "'"+txtAge.Text + ",";
Strcomm += "'" + "CONVERT(DATETIME,'" + txtBirth.Text + "', 102),'";
Strcomm += "'"+txtAddress.Text + "','";
Strcomm += "'"+txtDepartment.Text + "',";
Strcomm += "'"+txtSalary.Text + ",'";
Strcomm += "'"+txtHtel.Text+ "','";
Strcomm += "'"+txtMtel.Text + "','";
Strcomm += "'"+txtEmail.Text+"','";
Strcomm += "'"+txtPassword.Text + "')";
SqlConnection SQLconn = new SqlConnection(Strconn);
SqlCommand SQLcomm = new SqlCommand(Strconn, SQLconn);
try
{
SQLconn.ConnectionString = Strcomm;
if (SQLconn.State == ConnectionState.Open)
{
SQLconn.Close();
}
SQLconn.Open();
SQLcomm.CommandType = CommandType.Text;
SQLcomm.CommandText = Strcomm;
SQLcomm.Connection = SQLconn;
SQLcomm.ExecuteNonQuery();
}
catch (Exception Error)
{
MessageBox.Show("ไม่สามารถเพิ่มข้อมูลได้เนื่องจาก !!!!! " + Error.Message, "ข้อผิดพลาด", MessageBoxButtons.OK);
}
}
lmjojopjkopkop
|
|
|
|
|
Standard question #2:
What error message do you get?
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: Standard question #2:
What's Standard Question #1?
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Ed.Poore wrote: What's Standard Question #1?
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
I should have seen that coming
Maybe you should write an article of these standard questions?
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
This code is begging for a SQL injection attack. You should read up on what that means, your app is ripe for abuse.
if (SQLconn.State == ConnectionState.Open)
{
SQLconn.Close();
}
SQLconn.Open();
Why ?
As someone else said, we need to know what the error is. Your query may be malformed, but I'm not going to trawl through it to see. However, that's a SQL Server connection string, you should be using stored procs instead of dynamic SQL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I am working with Visual Studio 2005 (.NET 2.0) with C# for Windows Application.
When I dragged and dropped a Table from Data Source Explorer, I found that Binding Navigator was also added to the form automatically with "Save Button". After that I had to delete the Binding Navigator Control from the form for some reason. Later whenever I drag and drop a new data table from the data source, Binding navigator is no more added to the form. I had to add that manually from the control tool box. That is also fine, but the later Binding Navigator Control Doesn't contain "SAVE" button. How can I get that "Save" Button back to Binding Navigator Control ?
Thanks
Emran
|
|
|
|
|
Just add the button to the ToolStrip and then look at the BindingNavigator, there'll be a property to do with the which ToolStripButton is the Save Button, just set the appropriate one.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|
|
Hi,
Thanks for your reply.
I tried with your suggession, but I did not see any property in binding navigator for Save button,. But I found for ADD, Delete, First, Last etc..
Is there any reason that the SAve button item may not be asked by the property editor of Binding navigator ?
|
|
|
|
|
I suggest creating a new project just to see what code is generated, you can then duplicate that across to your project.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi,
I have some questions regarding some security issues.
1)
We are encrypting different fields in our MySql database. This is done in the C# code. We are going to start encrypting more fields but the problem is then to run the queries (sorting and so on). What is the best approach here - is the best way to use the encrypt/decrypt methods in the MySql instead or how do you usually do it? Database layer or application layer?
2)
What is the best obfuscating tool for .NET? Do they really protect against code decompiling?
3)
How do you store a encryption key in the best way? It doesn't feel secure to store it in the source code, but how do you protect it in the best possible (safest) way?
Thankful for some help from people that have experience in making secure systems in .NET.
// regards Patrik
|
|
|
|
|
1) - Sorry I'm not a database whiz, I can do simple stuff but you'd be better off getting advice from someone else.
2) - Don't know about which is the best, Preemptive seem to have a fairly good name. As to whether they prevent decompiling, in short they cannot. But what they do do is make it difficult for humans to interpret what the program is meant to be doing. Good example of this is Reflector, it will always decompile the code for you but the code will look very convulated although compilable and executable (otherwise it wouldn't run).
3) - One of the more secure ways to do this would be (if you can) generate the encryption key from at runtime, inserting in and / or removing values etc, just make it very difficult to decipher what's going on since anyone who can use Reflector can view your code. Everything is breakable it just depends on how much effort you want people to expend, thus eliminating the "hobbyist" (although they can be a bit more tenecious if they're interested) and curious people. It is unlikely that your code will ever surive pros but you can make it difficult.
As of how to accomplish this I wouldn't have a clue at the moment and I'm too lazy to google it
|
|
|
|