C :: Using COM Ports To Send Files Between Two PCs

Dec 2, 2014

My first time programming sth in Network. I have to use C to send a file to another PC, well COM port are useful but I didn't find how to refer to the address of my destination.

View 4 Replies


ADVERTISEMENT

C++ :: Get Input From Ports And Send Output

Jul 30, 2014

I'm learning C++. Is there some way to make program function on input from a port like usb port and can I send bits through the port? For example A usb cable connected to a circuit. I press a button and an AND gate on the circuit gets activated by a bit from the usb port and a fan in the room turns on.

View 1 Replies View Related

C# :: Send Multiple Files Over Tcp At The Same Time In C Sharp?

Nov 29, 2010

I have a tcp client - server implementation running in the same program, on different background worker threads. There will be instances of this program on multiple computers so they can send and receive files between each other. I can send files sequentially between computers using network stream, but how would I send multiple files at the same time from computer A to B.

Sending multiple files over one connection ( socket ) is fine, but having multiple network streams sending data to a client, the client doesn't know which chunk of data is apart of which file ?

View 3 Replies View Related

C :: How To Delete Files After SIGINT Has Been Send To Interrupt The Process

May 12, 2013

I have a program that makes a directory (temporary) and in it some files that are necessary for computation while program is running. Now suppose a user decides to interrupt the program at some stage. what happens is that the program stops but my folder and files remain.

Q: How to override SIGINT command so that before the the execution stops the folder is deleted ?

View 4 Replies View Related

C++ :: Control Usb Ports?

Mar 5, 2013

how to control usb ports in visual studio C++?

View 1 Replies View Related

C# :: Reading Byte From Serial Ports

Jun 8, 2014

how to use this function:

ftStatus = myFtdiDevice.Read(readData, numBytesAvailable,ref numBytesRead);

to read byte from the serial port.This function is part of the DLL that came with the chip(FT2232D) I am using on my board.I want to use the function to read a byte from the serial port and then send the value to the Graphic user interface.Unfortunately I was unable to get the expected value on my GUI.If I send for instance 40,what I get on the GUI are letters instead of the number 40 or at times the GUI will not even respond.Below are my lines of code I used to read the byte from the serial port:

The following instructions are executed whenever the CHECKBOX is checked

private
void checkBox1_CheckedChanged(object sender, EventArgs e)
{
UInt32 numBytesRead = 0;

[Code].....

View 3 Replies View Related

C :: Socket Programming Support Multiple Ports - Defined Variables

Sep 3, 2013

I want to put my socket programming example of how it can support multiple ports. I want to make the process more requests from distributing particles to create non-blocking structure

ports support ports defined variable.

Code:
#include "stdio.h"
#include "stdlib.h"
#include "unistd.h"
#include "errno.h"
#include "string.h"
#include "sys/socket.h"

[Code] .....

View 2 Replies View Related

C :: Program To Hide Files Behind Other Files Using Alternate Data Streams

Apr 5, 2013

I am writing a program to hide files behind other files using Alternate Data Streams in Windows NTFS file systems.

The program is as follows:

Code:

#include <stdio.h>
#include <stdlib.h>
int main(void){
char hostfile[75], hiddenfile[75], hiddenFileName[15] ;
printf("Enter the name(with extension) and path of the file whose behind you want to hide another file: ");
scanf("%75s", hostfile);

[Code]...

The complier is showing error as "Extra Perimeter in call to system" but I am not getting where?

View 4 Replies View Related

C++ :: Display Last 1000 Lines From Multiple Text Files (log Files)

Jan 16, 2014

I am writing a piece of code that requires me to display the last 1000 lines from a multiple text files (log files). FYI, I am running on Linux and using g++.

I have a log file from which - if it contains more than 1000 lines, I need to display the last 1000 lines. However, the log file could get rotated. So, in case where the current log file contains less than 1000 lines, I have to go to older log file and display the remaining. For e.g., if log got rotated and new log file contains 20 lines, I have to display the 980 lines from old log file + 20 from current log files.

What is the best way to do this? Even an outline algorithm will work.

View 6 Replies View Related

C :: How To Send A String To C# Application

Apr 1, 2014

i developed 2programm that the first one is in C and the second one is in c#.and now i have to send some string text from c to c#.how can i do that in c ?

View 8 Replies View Related

C :: Send HTTP With Sockets

Apr 9, 2013

I'm connecting to my website through sockets, like this:

Code:

#include <stdio.h>
#include <stdlib.h>
#include <winsock2.h>
#include <string.h>
int main(int argc, char *argv[]) {
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2,2), &wsadata) == -1)

[Code]...

I want to send GET to a certain web page. How can I do that?

View 2 Replies View Related

C :: Send Data Packet

Mar 6, 2015

how to send datapackets. When we send a data packet from device to another, say I have a "string". How Do I send it? Are data sent as a hex or binary number?If so do i first convert the "string" into hex or binary and then send it over the communication medium(say UART)??

I have two hex numbers to be sent using the UART, do i wrap it in some specific form and send it and retrieve it on the other side?Say if I have a data structure, in that case how do i send it? Sending data packets is very cruicial in an embedded system.

View 3 Replies View Related

C++ ::  Send Binary Data Over TCP/IP

Sep 3, 2014

I am writing a client-server program in C++ using C libraries. The server listens for a connection and when one is found, it is supposed to send a binary file(an image in my case) to the client. The server is sending the binary file perfectly after opening it and reading its contents into a buffer that is dynamically allocated in the SERVER file.

The problem begins when the client file is supposed to recv() the file, I do not know how I can allocate a buffer big enough for the file to be received. I know how to use malloc() and new, I prefer malloc() for executable size customization. Assuming the file being sent is 11000 bytes(note that this is an assumption and the client can not know the file size because the file size is dynamically generated by server).

How can the client generate a dynamically allocated buffer big enough to hold 11000 bytes?
OR
How can the client store the data in a buffer using recv() without knowing the file size.

Below is part of the code that does the send()'ing and recv()'ing.

SERVER

FILE *img = fopen("img.jpg", "rb");
fseek(img, 0, SEEK_END);
unsigned long filesize = ftell(img);
char *buffer = (char*)malloc(sizeof(char)*filesize);
rewind(img);
// store read data into buffer

[Code] ....

This outputs all the binary code perfectly but it is a bug because it can't be written to a file. Is there a way to dynamically increase the buffer until all filesize is received? Certainly, buffer needs to be dynamically allocated or program crashes ...

Also one more thing, when I telnet the server from command line, telnet displays all the output perfectly as well

Maybe telnet is storing data into a buffer behind the scenes, if so, how?

View 9 Replies View Related

C++ :: Send Info To PHP Webpage?

Jul 3, 2014

I was wondering if there was a way for me to send information, say a username and password, to a webpage via a c++ function. I was unsure how exactly to word it, but I did attempt to google it. Here is an example of what I mean.

App starts -> goes to "Https://www.my-site.com/?user=$username&password=$password" -> username/password is valid -> logs them in on desktop app

I do not know much about php, but I am assuming the ?user=$username is setting a variable, correct? I am familiar with sockets, but it seems using the above method, this could be possible without sockets, would it?

Important part:

That is the method that minecraft uses to login players, the question here is what function could I start to send the desktop app to the webpage.

EDIT:: After looking a little more I find that it is probably not possible without sockets, which is fine; however I don't know how to do it still, I would prefer to not use external libraries, such as Curl.

View 3 Replies View Related

C/C++ :: Send And Recv In Winsock2

Aug 4, 2014

so im just getting into network programming and im trying to make a chat server and client so i can send and receive messages. I have written both a chat and a client, with no error reporting (i know, i know). But the message that comes through on the server side is "hiiinaovH+". Ive represented this as well as i can but really they are non alphabetic symbols coming through.

client code:

#include <iostream>
#include <winsock2.h>
int main()
{

[Code]....

View 13 Replies View Related

C# :: Possible To Send Audio Over Mic Stream?

Mar 10, 2014

I'd like to be able to output sound over skype as if it were coming from my headset, how would I go about this?

View 1 Replies View Related

C# :: How To Send A Command To Another Form

Oct 12, 2014

I've been trying to send a command to another form, but it didn't work. Here's what I've done:

Form1:
I have a listview.

Form2:
I have a textbox and button.

I want to write something on the textbox from Form2, click on the button and let it appear on the listview on Form 1.

Here's my code, but doesn't work />

Form1
public void UpdateListBox(string data) {
ListViewItem lvi = new ListViewItem(data);
listView1.Items.Add(lvi);
}

Form2
private void button1_Click(object sender, EventArgs e) {
Form1 frm1 = new Form1();
frm1.UpdateListBox(textBox1.Text);
}

View 14 Replies View Related

C++ :: Send 2 Keystrokes To A Certain Program?

Sep 15, 2014

So I'm trying to send 2 keystrokes to a certain program. Let's say I would like to send the keystroke "1" twice, to notepad.

View 7 Replies View Related

C# :: Socket TCP Send / Receive

Jun 28, 2014

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace test {

[Code] ....

I don't know if this is a bug in Winsock or the .NET Framework but i need to fix this or workaround. Recently I was working on a networking class and this error is breaking everything.

If you add Thread.Sleep(1) after Send() call then "TCP Bug detected" doesnt get executed but its not a reliable fix.

View 7 Replies View Related

C# :: Send Value From Class To Listbox?

Mar 3, 2014

i've a function to add many buttons to TabbedPanel like is visible here

public void AddBeverageDrinkstoTabbedPanel(TabPage tp1, ListBox lst1) {
food getbeverage = new food();
string[] bev_product = getbeverage.name1;
FlowLayoutPanel flp1 = new FlowLayoutPanel();
flp1.Dock = DockStyle.Fill;
foreach (string value in bev_product)

[code].....

What happens? When i click in any button, want add an specific text to listbox and to do this i builded an method called beverageclick(), with these code:

public void beverageclick(object sender, EventArgs e) {
Button b = (Button)sender;//button sender
string value = (string)b.Tag;// value = b.tag (tag of sended button tag = value (value of AddBeverageDrinkstoTabbedPanel) method)

[Code] ....

What is wrong? how can i add an specific value when an button was clicked.

View 1 Replies View Related

C/C++ :: Getting Windows Don't Send Error

Dec 27, 2012

i am doing a structure program "struct book",but at the time of run cmd is opening and i am getting 'windows don't send' error and program has been terminating.

the code is following:

#include<stdio.h>
#include<conio.h>
display();  
struct book

[Code]....

View 3 Replies View Related

C/C++ :: How To Send PPM To A Function In Another File

Apr 7, 2015

I have an assignment where I have to alter a ppm image and send it to a function in another file to print the new altered version.

#include "transform.h"    
int main (int argc, char *argv[])  {  
    // declarations here
    FILE *inFile;      
    // open input file 
    inFile = fopen("tiger.ppm", "r")

[Code] ....

View 1 Replies View Related

C/C++ :: How To Send Many Images Through Socket

Jun 25, 2012

I have written a socket witch send an image 256x256 and now i want to send many images and i don't know what loop to write to make the socket after have sent the first image to send another and not to write the same program many times for every image ......

this is the part that read the binary image

if( !(fp=fopen("Anemos.bmp","rb"))) {
            printf("Unable to load bin file: %s...
","Anemos.bmp");

[Code] ....

View 2 Replies View Related

C++ :: Winsock - Receive / Send Sequences

Oct 25, 2013

I'm trying to understand winsock with c++. Let's assume I have a 2 working applications, one is the client and one the server:

Client: I can enter a command, for example chat or filetransfer, it will then switch into this specific mode where I can enter commands like uploading a file, send a message etc.

Client
Code: ....
while (rc != SOCKET_ERROR) {
printf("
#");
gets(buf);
if (strcmp(buf, "CHAT") == 0){
// start chat mode

[Code] .....

I'm in a recv/send loop and I'm using streams...so basically all the data is being sent/received there. Now, if I want to upload a file, I send a FILETRANSFER String to the server. Then I will probably need another loop that receives file requests from the client. The server will need more details about the file, like the path, name, size...

Now, my question is, what's the best practise for something like that? I'm having problems understand how I can send 3 different values from the server to the client and how he will receive them in the right order store them in variables. And also, after sending something to the server, in some cases, the client will have to wait for the server to answer.

Is there a good example of a similar application?

View 3 Replies View Related

C :: How To Send Programme Output To A Printer

Aug 10, 2013

I want to print the output of a c programme to a printer. Operating system is MS Windows xp sp2. This is the programme:

Code:
#include<stdio.h>
#include<conio.h>
void main()
{
printf("
Hello Chandan2... ");
getch();
}

The output "Hello Chandan2..." is to be printed in printer, when i run the programme , but how to do it?

View 6 Replies View Related

C :: Connecting To SMS Server And Send Messages

Nov 11, 2013

I'm currently in the middle of designing a program for some project. one part of the program is to send reminding SMS messages to the employees.

I have already subscribed to a SMS provider and they gave me an access to a control panel (aspx). But now I'm wondering how will I be able connect to the SMS server and be able to send messages?

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved