|
He's asking what you've done so far. What code have you got? What's not working?"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
// code is as follow, it executes without any exception but nothing happens at unix and i get the response as ??% all time
string message = "./mahesh/touch test_connection1";
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Blocking = true;
socket.Connect("10.111.16.199", 23);
TelnetStream stream = new TelnetStream(socket);
Byte[] data = System.Text.Encoding.ASCII.GetBytes(message);
stream.Write(data, 0, data.Length);
// String to store the response ASCII representation.
String responseData = String.Empty;
// Read the first batch of the TcpServer response bytes.
Int32 bytes = stream.Read(data, 0, data.Length);
responseData = System.Text.Encoding.ASCII.GetString(data, 0, bytes);
Console.WriteLine("Received: {0}", responseData);
// Close everything.
stream.Close();
socket.Close();
|
|
|
|
|
What happens if you telnet to this normally? Does it prompt you for credentials?"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
thanks for reply....
it doesn't prompt for login..
|
|
|
|
|
l.laxmikant wrote: it doesn't prompt for login.
Then something is wrong with your UNIX setup, telnet should always prompt for a login.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
l.laxmikant wrote: TelnetStream
What namespace is it in?
|
|
|
|
|
I've had to telnet into Unix systems and run some automated stuff before. (Five years ago, with C# 1.0 and .net 1.1)
I found a telnet client class somewhere, I'm not sure where, but probably not on CP. From that, I wrote my own and added the ability for it to execute command scripts -- with my own little scripting language.
It worked just great with only a few minor problems.
Unfortunately, my classes didn't get to a point where I felt I could write an article and publish them. I was actually working on that when I got laid off from that job.
Anyway, you need a telnet client class; just a socket won't do it. Does the current version of .net have a telnet client class? I haven't bothered to look.
P.S. My Telnet client class wraps a TcpClient object.modified on Wednesday, February 24, 2010 4:58 PM
|
|
|
|
|
Have you gotten it working? I got back to looking at my code yesterday and found that it isn't broken so I may be publishing it soon. If you found another class that does it could you let me know so I can check it out too?
|
|
|
|
|
Here[^] is my article on my TelnetSocket. Have a look and let me know what you think.
|
|
|
|
|
Hi,
I am the maintainer for Little Registry Optimizer. My program is getting error code 17 (The system cannot move the file to a different disk drive) whenever it tries to call RegReplaceKey to compact the registry hives. The weird thing about this error is that the old and new hives are both assigned using the same API and they are in the same directory and drive. I have been able to reproduce this error on my friends computer but not on mine. I have attached the error log below and the location of the registry hives on my friends computer. Please let me know if you have any ideas!
This is the code that is causing the error:
int ret = PInvoke.RegReplaceKeyA(this.hKey, null, this.strNewHivePath, this.strOldHivePath);
if (ret != 0)
throw new Win32Exception(ret);
This is the code that assigns the old and new hive paths
string tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
if (File.Exists(tempPath))
return GetTempHivePath();
return tempPath;
Error log: http://tinypaste.com/51dde[^]
Registry Hive Paths: http://tinypic.com/r/10pya37/6[^]
Thanks!
|
|
|
|
|
Does this happen all the time on your friends computer?
Do you run as admin on your? On his?
Can you copy a random file to those paths his computer?Opacity, the new Transparency.
|
|
|
|
|
According to the log you are trying to do a move (rename) of a file from one drive to another. This is not allowed by Windows. I have no idea what the actual paths are as your images are unreadable. Try posting the actual names with your log, in the message above rather than on obscure websites. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hi,
The files are being moved from one drive to another. If the picture worked, then you would see that the files are both in the same directory and on the same drive. I am going to see if it will work if they go to a different directory like C:\Temp because the other directory could be locked by windows. In regards to the other thread, this is being ran as admin and the process is getting all the privileges required to call the API. This is happening all the time on his computer but not my windows 7, vista, or XP.
Here is the picture of the hive paths:
http://www.pixhost.org/show/564/1626974_registry-woow.jpg[^]
Thanks
|
|
|
|
|
The problem is that these message boxes are not connected to the log. Try listing both names at the time that you log your error message so that you can see exactly which path is being complained of. It may be that there is a bug somewhere in the code that is corrupting a path. Also please post the details in your message here on the forum rather than linking to some external site. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Ok well, I guess I am on my own on this one cause you seem to be a jackass cause my logs and pictures arent together and on a different website. If you would click on the first thread you would see that the log is there. Nice to see that someone wont give me a decent answer for some retarded reason...
|
|
|
|
|
ub3rst4r wrote: you seem to be a jackass
ub3rst4r wrote: for some retarded reason.
I made a perfectly reasonable request to you for some consistent information, and you respond with these insults. Hardly the way to encourage people, who freely give their own time, to offer to help you in the future.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
There exist two table in DB, one contains the number of sets purchased, second contain sets send/delivered to customer.
there is a form on which i am showing details of sets i.e how much available in stocks.
DataTable dt = cINI.GetDataTable("Select [sName],[sPrice] from [sSet] Order By [sName]");
foreach (DataRow dr in dt.Rows)
{
ListViewItem lvItem;
lvItem = lvSets.Items.Add(dr["sName"].ToString());
lvItem.SubItems.Add(dr["sPrice"].ToString());
object inStock = cINI.ExcuteSQLScalar("Select Sum(mQuantity) from [mPurchase] where [mName] = '" + dr["sName"].ToString() + "'");
object sendSet = cINI.ExcuteSQLScalar("Select Sum(Quantity) from [SendSet] where [setName] = '" + dr["sName"].ToString() + "'");
if (inStock != DBNull.Value && sendSet != DBNull.Value)
lvItem.SubItems.Add( (Convert.ToInt32(inStock) - Convert.ToInt32(sendSet)).ToString());
}
Is there any other way to acheive this?
As its taking 4-5 seconds in showing up.
regards
|
|
|
|
|
You coud load table in Background thread.
How big is your database, and is it local or Remote, And is it Sql or accsess?
|
|
|
|
|
Saksida Bojan wrote: You coud load table in Background thread.
Need help on this, as no idea
Saksida Bojan wrote: How big is your database, and is it local or Remote, And is it Sql or accsess?
it's daily order booking, so eventually it will grow by day.
Its local, can be used on LAN. It is access.
|
|
|
|
|
Hum Dum wrote: Need help on this, as no idea Frown
Beginners Guide To Threading In .NET Part 1 of n[^]
If you use this approach. Data to be populated will still need 4-5 second, but it will not prevent UI from showing.
ps: I do not know where i read about foreach, but it is not recomended in some case. it is better to use for loop. It is said each loop will always recalculate how many it has
|
|
|
|
|
Saksida Bojan wrote: it is better to use for loop
No difference. Both takes same time.
|
|
|
|
|
Now i remeber where i read it. it was stream read using while(!reader.EOF) it is completly diffrent thing
|
|
|
|
|
I can think of two things you might try:
1. Instead of creating and executing the Sum(Quantity) queries every time through the loop, create them once as prepared statements then simply set the parameters each time. That should reduce the amount of work the database has to do and it should go noticeably faster for relatively little code changes.
2. Depending on how strong your SQL skills are, you could combine the queries together into a single query which gives you the data you need all in one go. That way, the database is doing the work of joining the tables together which you are currently doing in your foreach loop, and databases are designed to do that sort of thing efficiently.
|
|
|
|
|
my problem is like this
i have two different application like on-screen keyboard and excel sheet
in my problem i have:
1st application: form with number buttons.
2nd application: few forms with many texboxes in each.
now i need to fill those text boxes with number using 1st application
i want to how will 1st application know which text box of which form is having cursor and how will it send the data to it. i think it require knowledge of win32 api calls and all. which i very little idea. can u help me out in this .
thanks in advance
|
|
|
|
|