473,473 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to send log file from one computer to another computer in c#?

3 New Member
Expand|Select|Wrap|Line Numbers
  1. public partial class Loginform : Form
  2.     {       
  3.         public Loginform()
  4.         {
  5.             InitializeComponent();
  6.         }
  7.  
  8.         private void btnlogin_Click(object sender, EventArgs e)
  9.         {
  10.             if (!Directory.Exists(("//CENSYS06/C:/chandu/abc.txt")))
  11.             {
  12.                 Directory.CreateDirectory("//CENSYS06/C:/chandu/abc.txt");
  13.             }
  14.  
  15.             string dir = (("//CENSYS06/C:/chandu/abc.txt"));
  16.  
  17.             if (!File.Exists(dir))
  18.             {
  19.                 File.Create(dir);
  20.             }
  21.  
  22.             string filePath = dir;
  23.  
  24.             string s = System.Environment.GetEnvironmentVariable("COMPUTERNAME");
  25.             string s1 = getIP();
  26.  
  27.             using (StreamWriter swrObj = new StreamWriter(filePath, true))
  28.             {
  29.                 swrObj.Write(s1 + "|" + s + "|" + Txtusername.Text + "|" + "user logged in on :|" + DateTime.Now.ToShortDateString() + " at " + DateTime.Now.ToShortTimeString());
  30.  
  31.                 swrObj.Write("\t\t");
  32.  
  33.                 swrObj.Write("\t\t");
  34.  
  35.                 swrObj.WriteLine();
  36.  
  37.                 MessageBox.Show("Login success");
  38.             }
  39.         }
i am using c# wondows application i want to send log file from one computer another in c#,i am using above code not working?
Jan 10 '13 #1
1 2477
adriancs
122 New Member
You can use client/server to send it.
convert the file into byte[] from A (client)
A send the byte[] to B.
B (server) open a port and receives byte[] from A.
B convert byte[] and write it into file.

search tutorial of C# Client/Server in google.
Jan 14 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: b83503104 | last post by:
Hi, I want to append one (huge) file to another (huge) file. The current way I'm doing it is to do something like: infile = open (infilename, 'r') filestr = infile.read() outfile =...
0
by: Gregor | last post by:
Hello everyone, I have a problem with an ms-access ADP Project under Access XP and an SQL Server 2000. On my computer the program is running without any problems. Then I create a copy of the...
1
by: Nguyen Thanh Danh | last post by:
I'm a student, i try search on Internet but i can't find any sample how to send file throught socket, between 2 computer! Please help me! Thanks!
2
by: Selen | last post by:
I have a aspx file in my computer.I want to run it another computer in network. I write http://computername/filename but it doesnt work.Why can it be ? How can I solve the problem Thanks
1
by: irene | last post by:
Hi, I am trying to send an existing xml file to another machine(in some other company). We seem to be able to set up the connection to each other, but when I send the file, they never receive...
2
friendjin
by: friendjin | last post by:
I have done a programming, and I want to release this programming and use it in another computer. I used batch build to realse, but it can only use in my computer. If I copy whole file to another...
3
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, My ASP.net application has to fetch data from Excel sheet. I'm using HTML File Control to select an excel file. I'm using Microsoft.Jet.OLEDB.4.0 provider to fetch the data from excel....
1
by: krndhi1983 | last post by:
Hi to All, I am using Windows XP running IIS 6.0.I am developing a project using vb.net 1.1 with SQL Server 2000.It is a mobile project.So i am also using Pocket PC 2002 with SQL CE 2.0.When...
8
by: wassimdaccache | last post by:
Dear Experts, Hope everything is doing well. Do u have any idea how to send & receive an email from an outlook express to another computer in my network without going through the internet. ...
1
by: SalimZaabi | last post by:
Hi, I'm having problem in installing the setup file into another computer that has not have .Net framework. After I made a setup file to a project and I tend to install the setup file into...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.