Wednesday, May 6, 2015

How to go straight to the IPV4 configuration with a click of a button?

I have this requirement to open the IPV4 configuration of the Ethernet adapter, for which I have written the following code.

private void btnIPInfo_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            System.Diagnostics.ProcessStartInfo stInfo = new System.Diagnostics.ProcessStartInfo();
            stInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; //hide cmd window
            stInfo.FileName = "cmd.exe";
            stInfo.Arguments = " /C ncpa.cpl";
            process.StartInfo = stInfo;
            process.Start();
        }

This takes me to the network connections page, where

1) I click on Etherenet adapter,

2) Select IPV4 configuration and click on properties,

3) I get the window to input the IP information, Ip, subnet, gateway etc.

How can I get straight to  step (3) bypassing 1) & 2) ?

Appreciate any help..

Thanks

How to go straight to the IPV4 configuration with a click of a button?

I didn't find a direct way. In this thread the same question was asked but without the desired solution.

...

Another one: http://ift.tt/1dMJUF7

So, it doesn't seem to be possible.

From my own debugging experience caused by a local networking problem I had last year, I happened to come across functions in system dlls that were dealing with showing that dialog, but this does not seem to be documented anywhere.


Armin

How to go straight to the IPV4 configuration with a click of a button?

Here is an old thread which makes use of INetCfgComponent::RaisePropertyUi, but the API is deprecated, so it's just FYI.


Armin

Updating Label in runtime

I have updated Label in WinForm using BeginInvoke when I want to update it at runtime.

label1.BeginInvoke(new Action(() =>
{
    label1.ForeColor = Color.White;
    label1.BackColor = Color.Blue;
    label1.Text = "Ready to load...";
}));
How could I update label at runtime in case of WPF?

Design question/ideas for .Net Client Server application with deadlocking issue

I apologize as this issue almost sounds and reads like one of the questions I remember on one of my SQL Server certification exams from years back!

I have inherited a .Net Client-Server app with single sql server db on the back end.

Users make changes in the app at client machine then clicks save, the app's UI moves on and then writes background tasks (long running) still to process in the BackgrounTasks table and the the user can move on and do other things in the UI.

The background tasks in the BackgrounTasks table are then processed by a windows service(s).  Currently, the windows service runs either on the server with multiple threads or each client machine also has their own version of this service running that has one thread only.

The problem is everyone/everything is fighting over this BackgrounTasks table and deadlocking on it as everything is either reading or writing to it all the time.  This model/method scales horribly as more users = more deadlocks.  
The SQL DB setup uses pretty much all default options as far as collation and read-committed isolation (not read-committed snapshot, so I know read only trans are adding to the lock contention).

My first thought is to get rid of the background processing at the client machines and move that to just a single multi-threaded windows service on the server so there is one controlling unit and remove a lot of variables of what kind of client hardware, network perf, etc.  Resources and connectivity at the client machines are far from ideal.  Also, putting a version of the background processing windows service on each of the clients was a late addition thought to alleviate bottlenecks but has actually caused the issues to get worse.  I am looking for design ideas to minimize contention at the db level and eliminate the deadlocks and something that will scale well with more users.  

Any help is greatly appreciated!

Design question/ideas for .Net Client Server application with deadlocking issue

> I am looking for design ideas to minimize contention at the db level and eliminate the deadlocks and something that will scale well with more users.  

Post the deadlock XML and queries involved, and the table and index DDL of the tables.  It's usually just a matter of controlling locking behavior to force clients use a more restrictive lock earlier to avoid deadlocking.

Also describe the transactional behavior you need for the background tasks table.

David


David http://ift.tt/1c5QNcs

Design question/ideas for .Net Client Server application with deadlocking issue

Can you tell us a little about this table? Provide the DDL if you can and how much data would be typically included in the columns if you have things like varchar(max) or varbinary(max). Is it just a single write operation and then disconnect?

Can you provide transact sql statements for your insert, update, and read requests?

How large is this table and what are the indexes on it (provide indexes in DDL format please)? If you have indexes on data that frequently changes, for example, then a write operation could cause a lot of blocking which could cause the problems you are experiencing. If you have a poorly created index or query it could also cause blocking and increasing the number of clients would only increase overall wait time.

How is the code structured that calls the write/read? Are connections being closed immediately after use? Are transactions committed immediately after use? Are writes forced through a stored procedure or is this a direct INSERT or UPDATE statement generated in the code? Personally I would prefer a Stored Proc for writing to the table because it affords the Sql Admin flexibility to change/tweak it as needed without having to touch the client PCs.



Mark as answer or vote as helpful if you find it useful | Igor