|
What you are trying to do is unclear; please explain more clearly.
glennPattonWork wrote: Is this the 'correct' way of doing things or am I creating a kludge that will
come back and bite me later.
It might be OK, but I can't say for sure until I know what you are trying to accomplish.
Is there a database involved?
|
|
|
|
|
Hi,
Sorry about that I had not really had chance to proof read it when it got posted (mix of Web connection and finger trouble) What I am aiming to do is to create a load data files
such as Data001.msg, Data002.msg etc at the moment I have it updating a variable that goes to an ini file (I know, I am under orders to make an .ini, you bring up XML but no! separate story)I want the program to look at the location say there are six file with an .msg extension I would like the variable to be seven and create Data007.msg and on. I was trying to find a way to do this that wasn't too bad. Sorry, there is no database involved at this stage!
Glenn
|
|
|
|
|
glennPattonWork wrote: say there are six file ... I would like the variable to be seven
Well, then what about int FileTotal = file_text.Length ; ?
|
|
|
|
|
Thanks for that, I still wonder if I would better suited to something other than Windows programming!
|
|
|
|
|
|
Hmmm, LINQ never messed with it, I have a look....
|
|
|
|
|
|
Thanks for that when I have the time I will take a look at using LINQ, PIEBALDconsult's method works for what I am trying to do, can you recommend any sources for LINQ ?
|
|
|
|
|
|
I had found the MSDN stuff, so it looks like I have been LINQ'ing for a time with out realizing it....
|
|
|
|
|
|
|
There are obviously fairly serious synchronisation issues here, if there is any chance you could have two threads or two applications running at the same time. You probably realise that but just making sure!
|
|
|
|
|
As far as I am aware at the moment I have only one thread on the go! Thanks for the heads up though!
|
|
|
|
|
is it possible to make ping to another computer in windows-mobile
using C# code ?
thanks
|
|
|
|
|
Please don't crosspost. Pick one forum and stick with it.
|
|
|
|
|
I m new in this C# language so i find problem in talking sound input from mic.
I don't know how to use API and want to solve this problem without using API
|
|
|
|
|
|
Is there any other way which can someone send post or get values with C# to PHP and previewing them with PHP in internet explorer??
An 100% solution is to use ProcessStartInfo( "my link&value = ","my data");
And when i'll do a echo $_GET['value'] it returns my data just fine. But the problem is that i have to do with million or billion values.
If i put on and EventHandler which reads from serialport,
Then IE or other browser will opens me million or billion tabs!!! What should i do for this way or propose me something else please???
Thanks
All the truth becomes from knowledge...
|
|
|
|
|
Why don't you collate all this data together and show all of this in a single tab by just sending one echo value.
|
|
|
|
|
I'm reading my data from a device. So i want these values to preview in a website realtime too in a PHP website.
How to do something like that?
Thanks
All the truth becomes from knowledge...
|
|
|
|
|
Why do you want to use a browser for this? What you want to do most of the time is update a value – a web page is not the ideal medium for that. Just use a form with some labels or a table or however you want to visualise the data, and update it whenever you get a new value.
|
|
|
|
|
They want to do something like that. They want to display my data both C# and IE php website realtime too.
All the truth becomes from knowledge...
|
|
|
|
|
Push the data into a database or something else that the website can look at, and have the website auto-refresh its data sections via an AJAX callback.
|
|
|
|
|
Hello everybody!I want to ask you something. I want to send values from C# windows form application in php webpage.In other words send post values from C# to php.
The problem is that php script cannot read this values and preview this results which comes from C# app.Could you help me please?
Here is the C# code:
using System;
using System.Net;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Text;
using System.IO;
namespace WebRequestExample
{
class WebPostRequest
{
public string Post(IDictionary<string, string> objects)
{
WebRequest request = WebRequest.Create("http://127.0.0.1/sensor.php");
request.Method = "POST";
StringBuilder b = new StringBuilder();
foreach (KeyValuePair<string, string> o in objects)
b.Append("?").Append(HttpUtility.UrlEncode(o.Key)).Append("=").Append(HttpUtility.UrlEncode(o.Value ?? ""));
string postData = b.ToString(1, b.Length-1);
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
if (((HttpWebResponse)response).StatusCode != HttpStatusCode.OK)
return null;
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
return responseFromServer;
}
class MainClass
{
public static void Main(string[] args)
{
WebPostRequest a = new WebPostRequest();
IDictionary<string, string> postData = new Dictionary<string, string>();
postData.Add("data", "123156564648989");
Console.WriteLine(a.Post(postData));
Console.ReadLine();
}
}
}
}
And a very simple php script to display the post data!
<?
<pre> print_r($_POST);
echo $_POST['data'];
echo '<br>';
echo $_REQUEST['data'];
echo '<br>';
var_dump( $_REQUEST);
echo '<br>';
echo '<file_get_contents>';
$postdata = trim(file_get_contents('php://input'));
$postdata = urldecode($postdata);
var_dump( $postdata);
echo '<br>';
?>
?>
Could you help me please? I repeat that the problems is that PHP cannot preview the POST data which becomes from C# windows form application. It always returns NULL.
Thanks alot!
All the truth becomes from knowledge...
|
|
|
|