send

In Java, send commands to another command-line program

天大地大妈咪最大 提交于 2019-11-28 00:06:43
问题 I am using Java on Windows XP and want to be able to send commands to another program such as telnet. I do not want to simply execute another program. I want to execute it, and then send it a sequence of commands once it's running. Here's my code of what I want to do, but it does not work: (If you uncomment and change the command to "cmd" it works as expected. Please help.) This is a simplified example. In production there will be many more commands sent, so please don't suggest calling

Sending UDP Packet in C#

人走茶凉 提交于 2019-11-27 19:05:57
I have a game server (WoW). I want my players to download my custom patches to the game. I've done a program that checks for update/downloading things. I want my program to send a packet to my game server if player have all my patches. I dont need any response from the server, it will handle it, but its another story. So I want to know, how to send a packet to a server. Thank you! Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPAddress serverAddr = IPAddress.Parse("192.168.2.255"); IPEndPoint endPoint = new IPEndPoint(serverAddr, 11000); string text

Is there a limit when using php mail function?

一个人想着一个人 提交于 2019-11-27 15:40:19
I am using php and mysql. I am going to send 10k++ (ten thousands plus) emails to update my subscribers, and this is the first time I am going to send them. I will use php mail function, basically here is what I will do: First get the data from database: Select name, email FROM data After that, using while loop to send the data: while($r = mysql_fetch_assoc($exe)){ ... if($mail){ echo "success<br>"; } else { echo "failed<br>"; } } echo "Sent all"; I include the if.. else statement, to ensure that each email is sent successfully. Is there anything I need to take care of? Will I have any

Send redirect to relative path in JSP?

强颜欢笑 提交于 2019-11-27 14:49:14
response.sendRedirect("../seja/izpisknjig.jsp"); the file in which I execute this line is index.jsp. the directory structure looks like this. project --index.jsp seja --izpisknjig.jsp How do I form the relative path to redirect to izpisknjig.jsp. Most reliable would be to create a domain-relative URL with the context path included. response.sendRedirect(request.getContextPath() + "/seja/izpisknjig.jsp"); You can use JSP taglib to do redirection. Content of index.jsp file : <jsp:forward page="../seja/izpisknjig.jsp" /> If project and seja are at root of your webapp context ( ie. http://host

Python Socket Send Buffer Vs. Str

感情迁移 提交于 2019-11-27 14:28:13
I am trying to get a basic server (copied from Beginning Python) to send a str. The error: c.send( "XXX" ) TypeError: must be bytes or buffer, not str It seems to work when pickling an object. All of the examples I found, seem to be able to send a string no problem. Any help would be appreciated, Stephen import socket import pickle s = socket.socket() host = socket.gethostname() port = 80 s.bind((host, port)) s.listen(5) while True: c, addr = s.accept() print( "Got Connection From ", addr ) data = pickle.dumps(c) c.send( "XXX" ) #c.send(data) c.close() It seems you try to use Python 2.x

How send data to website by using android app

試著忘記壹切 提交于 2019-11-27 13:49:13
I'm trying to send some data to my website. When the button is clicked, data need to be sent to the web site but I got some errors when I am running the program when I clicked the button this message appears "unfortunately app has stopped" then it exit my application. public class testInput extends Activity { Button Setbutton; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.test_input_page); Setbutton=(Button)findViewById(R.id.setbtn); Setbutton.setOnClickListener(new OnClickListener()

Sending message through WhatsApp By intent

一曲冷凌霜 提交于 2019-11-27 13:21:53
How I can send massage from my app to Special number in whatsapp , I know this code to share massage to group or contact on whatsapp Intent waIntent = new Intent(Intent.ACTION_SEND); waIntent.setType("text/plain"); String text = "Sorry For Interruption,I'm Just Trying Something"; waIntent.setPackage("com.whatsapp"); if (waIntent != null) { waIntent.putExtra(Intent.EXTRA_TEXT, text);// startActivity(Intent.createChooser(waIntent,"Share with")); but I want send massage to Special number like "966xxxxxxx" how I can do that ? Abdullah AlHazmy this is a Solution : private void openWhatsApp(String

With C TCP sockets, can 'send' return zero?

大城市里の小女人 提交于 2019-11-27 12:51:18
Is it ever possible for the C send function to return zero when using TCP sockets? The man page just says that it will return the number of bytes sent, but I am not sure if it will just return -1 when it can't send any data. I'm pretty certain, though the memory is deep in the mists of time, that I've seen it return zero before, in the situation of massive data transfers where the other end was not keeping up. From memory, in that case, the remote TCP stack buffers had filled up, the stack had notified the local end that it was to delay until some space was cleared out and the local buffers

How sendmsg works?

泪湿孤枕 提交于 2019-11-27 09:42:22
问题 As you know sendmsg has this declaration: int sendmsg(int s, const struct msghdr *msg, int flags); and msghdr structure has this form: struct msghdr { void * msg_name; /* optional address */ socklen_t msg_namelen; /* size of address */ struct iovec * msg_iov; /* scatter/gather array */ size_t msg_iovlen; /* # elements in msg_iov */ void * msg_control; /* ancillary data, see below */ socklen_t msg_controllen; /* ancillary data buffer len */ int msg_flags; /* flags on received message */ }; As

Send some keys to inactive window with python

巧了我就是萌 提交于 2019-11-27 09:06:49
I'm tryin to send some keys to inactive window/process/programm (win32/64) using python. Already read about pywinauto and SendKeys, but both of them activate window before sendin keys. Is there any way to work with inactive window without activate it? It would be great if someone post simple example/snippet. Thanks. Lithian Coth This is a really old post but there has not been an answer here, I was looking for something exactly like this, and I had spend 6 hours going through Stackoverflow, and ended up just reading all the C documentation because it was more useful. <python> #you will need