|
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
how to get the tracing information in a c# function call using zipkin .
please try to give reply as soon as possible if you know .it is very important for me
i am unable to get anything .i tried combining several codes together .but it's not working .please try to make some video on this topic that is how to connect a c# program with zipkin
|
|
|
|
|
Plz send videoz! That's a new one!
Why not ask on the Zipkin chat channel? openzipkin/zipkin - Gitter
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
i already asked there but didn't get any proper reply from there
|
|
|
|
|
If I were you, I'd look at using something like this[^].
This space for rent
|
|
|
|
|
Standard, High Definition or ULTRA High Definition?
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I have some problem for- transfer xml file from one server to another using ip address ,same network is working fine,but different network is not working,cant able to connect,anybody can help me to solve this
|
|
|
|
|
How are you trying to do the transfer? Also, what connection problems are you getting, could it be firewall blocking access?
|
|
|
|
|
Can you provide us with more details? What have you tried so far ?
Post your code here.
When you say different network , how do you connect to the network? Do you have permission to connect to the network? ( Credentials etc).
|
|
|
|
|
Yes thats the problem how to connect remote system using ip address using coding
|
|
|
|
|
Show us some code
Tell us where the code breaks
What works
What dosen't
We're not claivoiant
|
|
|
|
|
private void FileSave()
{
SqlConnection con = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand("Sp_Rep", con);
cmd.CommandType = CommandType.Text;
con.Open();
string val = cmd.ExecuteScalar().ToString();
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml(val);
xmldoc.Save("C://Shankar//Shankar.xml");
FromLocal();
ToRemote();
con.Close();
}
public void FromLocal()
{
try
{
//string hostName = Dns.GetHostName(); // Retrive the Name of HOST
// Get the IP
//string myIP = Dns.GetHostByName(hostName).AddressList[0].ToString();
Console.WriteLine("That program can transfer small file. I've test up to 850kb file");
Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
// m_socWorker = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
//String szIPSelected = "172.31.1.111";
//String szPort = "80";
String szIPSelected = "10.2.2.28";
String szPort = "580";
int alPort = System.Convert.ToInt16(szPort, 10);
System.Net.IPAddress remoteIPAddress = System.Net.IPAddress.Parse(szIPSelected);
System.Net.IPEndPoint ipEnd = new System.Net.IPEndPoint(remoteIPAddress, alPort);
sock.Connect(ipEnd);
//IPEndPoint ipEnd = new IPEndPoint(IPAddress.Any);
// Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
///Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
// sock.Bind(ipEnd);
sock.Listen(100000);
//clientSock is the socket object of client, so we can use it now to transfer data to client
if(ipEnd != null)
{
Socket clientSock = sock.Accept();
string fileName = "Shankar.xml";
string filePath = "C://Shankar//Shankar.xml";//Your File Path;
byte[] fileNameByte = Encoding.ASCII.GetBytes(fileName);
byte[] fileData = System.IO.File.ReadAllBytes(filePath + fileName);
byte[] clientData = new byte[4 + fileNameByte.Length + fileData.Length];
byte[] fileNameLen = BitConverter.GetBytes(fileNameByte.Length);
fileNameLen.CopyTo(clientData, 0);
fileNameByte.CopyTo(clientData, 4);
fileData.CopyTo(clientData, 4 + fileNameByte.Length);
clientSock.Send(clientData);
Console.WriteLine("File:{0} has been sent.", fileName);
clientSock.Close();
Console.ReadLine();
}
}
catch (Exception ex)
{
Console.WriteLine("File Receiving fail." + ex.Message);
}
}
public void ToRemote()
{
try
{
Console.WriteLine("That program can transfer small file. I've test up to 850kb file");
IPAddress[] ipAddress = Dns.GetHostAddresses("localhost");
IPEndPoint ipEnd = new IPEndPoint(ipAddress[0], 5656);
Socket clientSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
clientSock.Connect(ipEnd);
byte[] clientData = new byte[1024 * 5000];
string receivedPath = "C://Shankar//Shankar.xml";
int receivedBytesLen = clientSock.Receive(clientData);
int fileNameLen = BitConverter.ToInt32(clientData, 0);
string fileName = Encoding.ASCII.GetString(clientData, 4, fileNameLen);
Console.WriteLine("Client:{0} connected & File {1} started received.", clientSock.RemoteEndPoint, fileName);
BinaryWriter bWrite = new BinaryWriter(System.IO.File.Open(receivedPath + fileName, FileMode.Append)); ;
bWrite.Write(clientData, 4 + fileNameLen, receivedBytesLen - 4 - fileNameLen);
Console.WriteLine("File: {0} received & saved at path: {1}", fileName, receivedPath);
bWrite.Close();
clientSock.Close();
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine("File Sending fail." + ex.Message);
}
}
|
|
|
|
|
|
can you send me the c# code as how to add a click event for the notification text that appears in the notification window to "[DELETED]@gmail.com"
[edit]Email removed - OriginalGriff[/edit]
modified 10-May-17 14:03pm.
|
|
|
|
|
We don't write code to order here.
Speed of sound - 1100 ft/sec
Speed of light - 186,000 mi/sec
Speed of stupid - instantaneous.
|
|
|
|
|
Yeah .. sorry about that.
This is actually the "no free" Code Project.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Nope. And do yourself a favour: Never post your email address in any forum, unless you really like spam! If anyone replies to you, you will receive an email to let you know.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Did you mean to post this in a forum at the bottom of an article? You are more likely to get an answer to your question if you post in the appropriate place. We have no idea what notification window you are referring to
|
|
|
|
|
Which C# code are you referring to ? Don't assume that we are taking orders here.
|
|
|
|
|
Hi,
I have a product (Financial System) connected to SQL server databases via Web Service,
I need to make this product as a cloud service such as I will publish the web service on My servers and also publish the clients SQL databases on our servers and the clients only download the client application (Financial System) and install it on their PC's.
Please let me know what is the best case to manage the clients accounts and registrations and what is the best solution for this.
Thanks All
|
|
|
|
|
Nobody is going to be able to answer this question as we know absolutely nothing about your system and requirements. There are lots of ways to do this, but what you do is up to you and your research against your requirements.
|
|
|
|
|
Zeyad Jalil wrote: I need to make this product as a cloud service such as I will publish the web service on My servers and also publish the clients SQL databases on our servers and the clients only download the client application (Financial System) and install it on their PC's. Do you know what you want, or want to build?
A cloud service, has nothing to do with that much of hosting, downloading. A cloud service is a cloud service, you just publish once. There is not this much of a churn in the process and you provide not the application, but models; Saas, PaaS etc.
What you should focus on is SaaS. You would require to build it that way, then purchase any cloud subscription to get started and learn how they would support your needs.
Going cloud is of no use, if there is a lot of Ops going on everywhere.
Quote: Please let me know what is the best case to manage the clients accounts and registrations and what is the best solution for this.
Same, you have to think of these things first. On cloud, you are also provided an amount of data. But, what to purchase? 1) Relational database 2) No SQL database? That depends entirely on your data, your needs and your customers.
Share some more insights, so that we may guide you on this concept.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Hello guys, i really need help for this
i'm writing in C# a client-server (not important maybe, but it's for a game), probably i need more knowledge and clarification about the process.
Firts of all, the process is the same for client and server, and EVERYTHING IS (+or-)WORKING.
My code should explain what i'm doing
new Thread(() =>
{
int i = 0;
while (true)
{
byte[] bytes = new byte[102400];
NetworkStream stream = client.GetStream();
int received = stream.Read(bytes, 0, bytes.Length);
Console.WriteLine("Packets: " + ++i);
var basepacket = TNetwork.Encaps.Deserialize(bytes, 0, received);
Thread.Sleep(1000);
}
}).Start();
But there are some points that i don't get.
1) If i Send packets quickly
while(spamtest)
bp.Send(stream, ...);
the other point doesn't process all incoming data if it is busy (send 1000, processed 200). How to solve? i won't lose informations. there are no a kinda of SampleAndHold system? How is possible that i'm losing tcp packets just cause the program was busy??
2) I tried to send some data of 2k over the network (with another pc) but i had no problems. MTU is 1500 so my endpoint should crash getting incomplete binary-serialized-classes ! No?
I'm going crazy. My implementation is ok or i'm missing something?
3) Maybe client.GetStream(); can i only write or read at once? If i write, can't read? neither with 2 threads?
4) Probably i have to separate the Send process to a Queue in another thread.
5) What does exactly the flush()? I need to use it? I tried with and without Flush() after stream.write no differences (autoflush is false).
6) if i let client spam 70.000 packets, at the end one of both crashes
Help me please, getting crazy. Thanks
modified 10-May-17 8:17am.
|
|
|
|
|
Your code shows some misunderstandings: the inner while loop will start many threads in very short intervals - likely long before any of the already started threads has finished its work. A short wait time in between may be appropriate.
Your comment
// Do works ... Consider that classes are shared between clients and servers
// so classes are Invoked ... is unintellegible. What is the problem you want to solve with that? And why do you think your solution does so?
Also, I don't see any use of int i = 0 .
The code may become better readable when you refactor the bodies of the threads into functions.
Also note that an exception in a thread may crash your program if you don't handle it inside that thread.
|
|
|
|
|
Hi, i have removed useless code.
Now you can see, with Thread.Sleep(1000) i lose a lot of packets (more time, more loss. ~1000sent, ~40received). The above sketch code is the receiver.
What can I do to avoid losing packets?
Yes i know about handle inside threads
Hope you can help me, Thanks
|
|
|
|