|
Hi,
I have developed a system which copies the files from the remote servers and put it on the local server for further process on the files.
I have around lots of remote servers shared for that and having good amount of files everyday.
My system is a single thread system and goes to each server line by line, The issue is some time it gets hanged while coping the files from one of the server because of many reasons of network and does not go ahead for the other remaning server.
I am using C# and normal file.Copy method to do that.
Please tell me what is the best method of doing it and making system more better.
Thanks.
Nitin
|
|
|
|
|
How to call a stored procedure from sybase in .net(c#)?
I am using a OleDB connectionstring to connect to sybase database, but I don't know how to call a stored procedure to execute. Can anyone help, please?
|
|
|
|
|
hi,
i have some problems using the functions
LsaEnumerateLogonSessions
LsaGetLogonSessionData.
is there a simple sample for using this functions.
maybe the problem is my structure (forgive me the vb-code)?
<structlayout(layoutkind.sequential, charset:="CharSet.Auto)"> _
Private Structure SECURITY_LOGON_SESSION_DATA
Dim Size As UInt64
Dim LogonId As LUID
Dim UserName As LSA_UNICODE_STRING
Dim LogonDomain As LSA_UNICODE_STRING
Dim AuthenticationPackage As LSA_UNICODE_STRING
Dim LogonType As UInt64
Dim Session As UInt64
Dim Sid As IntPtr
Dim LogonTime As Int64
Dim LogonServer As LSA_UNICODE_STRING
Dim DnsDomainName As LSA_UNICODE_STRING
Dim Upn As LSA_UNICODE_STRING
End Structure
many thanks in advance.
regards, thilo.
|
|
|
|
|
Hello,
How can I format the decimal output to 4 decimal points only?
Thank you.
|
|
|
|
|
Use the formatting in the ToString method:
string shortPi = Math.PI.ToString("0.0000");
---
b { font-weight: normal; }
|
|
|
|
|
// Create a NumberFormatInfo object and set several of its
// properties that apply to numbers.
NumberFormatInfo provider = new NumberFormatInfo( );
string formatter = "{0,22} {1}";
// These properties will affect the conversion.
provider.NegativeSign = "minus ";
provider.NumberDecimalSeparator = " point ";
// These properties will not be applied.
provider.NumberDecimalDigits = 4;
provider.NumberGroupSeparator = ".";
provider.NumberGroupSizes = new int[ ] { 3 };
Convert.ToString( ObjDouble, provider ) );
Live Life King Size
Alomgir Miah
|
|
|
|
|
Hi
I have the following problem: I generate an XML file that has a CDATA section that contains character references (characters created by the XmlTextWriter in order to conform to well formatted XML and are in the form: , ). When I read the xml with an XmlTextReader I get the escaped strings instead of the characters. (I get "" instead of '\0' for example)
using reader.ReadChars(...) has the same effect.
Any ideas?
TX
|
|
|
|
|
Hey all,
I'm new to web app dev so I'll ask a simple question..
I created a simple chat application with client & server sockets.
after initialation & establishing the connection, I send text message to the server.
when I send the first message, the server gets it and displays it,
now, I realized that after the client sends the first message to the server, I need to reconnect to it again in order to send another message(s)..
The question is Do I need to reconnect to the server everytime, even though I have the server & client socket objects initialized...
my client code is like this:
private void btnSend_Click(object sender, System.EventArgs e)
{
btnConnect_Click(sender, e);//without this proc. I can send only 1 msg
try{
string msg = TxtSnd.Text+"<eof>";
byte[] byteData = Encoding.ASCII.GetBytes(msg);
lblstts.Text = "Sendeing...";//status label
clientMe.Send(byteData);
TxtSnd.Text = "";//delete text from TextBox
}catch(Exception Ex)
{
MessageBox.Show(Ex.Message);
}
}
|
|
|
|
|
Hi,
It is possible to add a key to the c# dll so that
when other application call it, the application need
the key to use the dll ? And how to do that ?
Thanks
|
|
|
|
|
NewtonInTown wrote:
It is possible to add a key to the c# dll so that
when other application call it, the application need
the key to use the dll ?
The short answer is no.
The long answer is maybe. This is possible only if all the methods you write in this .DLL are written to accept a key and validate it. This is something I don't think you want to do in every property and method you expose.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
So long as both assemblies have a strong name, you can add a StrongNameIdentityPermissionAttribute[^] to the class library at the assembly level. As a result, only applications signed with your private key will be able to access the library.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hmmm... Didn't know about that one.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have two decimal numbers, and I want to use mod function to get
an integer number. But it seems it's only available for SQL.
Is there a nice way of deviding two decimals and rounding off the result to a nearest integer?
Thank you
|
|
|
|
|
int x = Convert.ToInt32(10.0/2.4);
Live Life King Size
Alomgir Miah
|
|
|
|
|
Thank you,
I am so stupid I am already using Convert method.
|
|
|
|
|
Hi,
I am trying to use a C# Windows Forms application as a DDE Client.
At present I'm using the follwing code to initiate a session with the DDE Server...
ushort app = GlobalAddAtom(Marshal.StringToHGlobalAnsi(appname));
ushort topic = GlobalAddAtom(Marshal.StringToHGlobalAnsi(topicname));
this.packedParam = PackDDElParam(WM_DDE_INITIATE, (System.IntPtr)app, (System.IntPtr)topic);
SendMessage(dtaProcess, WM_DDE_INITIATE, Process.GetCurrentProcess().MainWindowHandle, this.packedParam);
This should return a WM_DDE_ACK message to the main thread as follows...
protected override void WndProc(ref Message m)
{
\\WM_DDE_ACK = 996
if (m.Msg == 996)
{
MessageBox.Show("");
}
else
{
base.WndProc (ref m);
}
}
I do not receive the WM_DDE_ACK message. Also, the PackDDElParam method (user32.dll) returns a negative value. Is this correct?
|
|
|
|
|
Hi,
Can anybody provide me documentation of Expression Evaluator Project implemented in C# by werdena,on this site ,please help me if you can.
Thanx.
|
|
|
|
|
You'll have to go to the article that you downloaded it from, scroll to the bottom of the page and you'll find a discussion board just like this one. Post a question asking for additional information there. Articles are, for the most part, supported by the people that wrote them.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi at all,
Im developing a custom control based on CF DataGrid. I added new functionalities like customizable rows height and another bit changes.
My problem is that i cant add the control in the toolbar because it appear disbled (gray colour).
I have read some articles, but im lost.
Anybody can help me?
Thanks in advance
Juan (sorry for my bad english).
|
|
|
|
|
when i use procedure
CommandType is procedure
and then run ExecuteNonQuery()
the return value of ExecuteNonQuery() is always -1
so the return value of ExecuteNonQuery is useless when use procedure?
|
|
|
|
|
It executes the query and just return the no of rows affected.
|
|
|
|
|
|
Hai
For UPDATE, INSERT, and DELETE statements, the return value is the number of rows affected by the command. For all other types of statements, the return value is -1. If a rollback occurs, the return value is also -1.
For more information See
SqlCommand.ExecuteNonQuery Method[^]
|
|
|
|
|
|
the procedure execute correctly and the data in DB changed.
but the return value is -1
why?
return value just useful when execute sql query?
|
|
|
|