|
i would imagine that StringBuilder would be close, but i'm not all that familiar with java.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I don't think there is one. However, a string is really a null terminated character array + it has a ToCharArray method. As the previous poster said there's also the string builder if you need it.
Another alternative is to use a List<char>
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hi,
I'm trying to run a ccxml, and consequently, a voiceXML page externally from the server (like through my application) and the documentation of the server mention that it can be done using HTTP POST.
Following is a simple example of html that works and successfully starts a call on a remote destination
<html>
<body>
<form method="post" action="http://localhost:4045/basichttp" enctype="application/x-www-form-urlencoded">
ID="Form1">
name: <input type="text" name="name" size="40" value="OutBoundCallEvent" id="Text1" />
<br />
URI to be contacted by the outbound: <input type="text" name="ToBeContacted_URI" size="52" value="10.2.50.42" id="Text5" />
<br />
VoiceXML URI: <input type="text" name="VoiceXML_URI" size="73" value="file:///C:/voiceXML/three.vxml">
ID="Text6" />
<br />
CCXML URI: <input type="text" name="uri" size="75" value="file:///C:/CCXML/outboundcall.ccxml">
ID="Text7" />
<br />
<input type="submit" id="Submit1" name="Submit1">
</input></input></input></form>
</body>
</html>
But I want to achieve the same effect through my c# application and I am using HttpRequest and HttpResponse to mimic submitting the form above.
following is my attempt on this
string uri = @"http://localhost:4045/basichttp";
string data = @"name=OutBoundCallEvent&ToBeContacted_URI=10.2.50.42&VoiceXML_URI=file:///C:/voiceXML/three.vxml&uri=file:///C:/CCXML/outboundcall.ccxml";
byte [] bytes = System.Text.Encoding.ASCII.GetBytes(data);
HttpWebRequest req = (HttpWebRequest) WebRequest.Create(uri);
req.ContentType = "application/x-www-form-urlencoded";
req.Method = "POST";
req.ContentLength = bytes.Length;
System.IO.Stream os = req.GetRequestStream();
os.Write (bytes, 0, bytes.Length);
os.Close();
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();
if (resp== null)
{
MessageBox.Show("Problem in sending response!");
}
System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
string result = sr.ReadToEnd().Trim();
MessageBox.Show("All done!");
Now when I try to get the response using HttpResponse I get an error " The remote server returned an error: (400) Bad Request."
Q1 Does writing the data into the stream means the server has send the data just like pressing the submit button? or does the using the gerResponse method this happens?
Q2 Is there something im missing in order to achieve a simple submit function? I have tried sending some data over to an asp page and use response like above and it all seems to work fine.
Any help will be greatly appreciated.
Kind Regards
Fahd
|
|
|
|
|
I found out the problem I am not sending the data string in the proper format it requires escape characters for slashes etc!!!
Btw just to share I was advised to use a tool called Fiddler to examine the data sent to the server which in turn lead me to find out my mistake. Seems to be a pretty neat tool.
Fahd
|
|
|
|
|
Hi,
I had written a webservice.Now I need help to accompolish the following goals..
1.How to host the webservice?..since this i have to use in windows application.
2.How to consume this webservcie through the C#.net windows application.
My task is to write the Webservice,using this I will pick some data and that data I have to pass to a windows application/windows service where I will update the database.
|
|
|
|
|
balu12345 wrote: had written a webservice.Now I need help to accompolish the following goals..
OR
balu12345 wrote: My task is to write the Webservice,using this I will pick some data and that data I have to pass to a windows application/windows service where I will update the database
So you haven't written it then.
balu12345 wrote: 1.How to host the webservice?..since this i have to use in windows application.
Webservices have to be hosted in a web server - there is a clue in the name
It looks to me like you want someone to do your homework.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
or to fulfill a contract for em that shouldnt have been takin in the first place. i'm all for learning new things but one should at least do a bit of reasearch about what a client wants before agreeing to provide it.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi
I don't know to do it..I need guidence but not the code.This is first time Iam working with webservice and windows applications.So I held all your help ...
|
|
|
|
|
Try BOL or Google, there are plenty of examples. Its far big a topic to cover in a forum.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi,
I have a form with a status bar that I want to be maximized whenever it is shown.
I don't want the form to have maximize or minimize buttons so I have set MaximizeBox and MinimizeBox to false. But whenever the form is shown it totally overlaps the taskbar effectively making it invisible.
I have played around with various combinations of FormBorderStyle and MaximizeBox/MinimiszBox/ControlBox settings to no avail.
The code below is enough to reproduce the problem I am having.
Any ideas how to achieve what I'm looking for.
Thanks,
dlarkin77
public class FormTest : Form {
private StatusStrip statusStrip1;
private System.ComponentModel.IContainer components = null;
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
private void InitializeComponent() {
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.SuspendLayout();
this.statusStrip1.Location = new System.Drawing.Point(0, 395);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(643, 22);
this.statusStrip1.SizingGrip = false;
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(643, 417);
this.Controls.Add(this.statusStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FormTest";
this.Text = "FormTest";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
public FormTest() {
InitializeComponent();
}
}
|
|
|
|
|
forget about the maximized start up state and set the size of the form manually (and the location).
this.Location = new Point(0, 0);
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
Not sure if you can do this in the designer - if not, put it in the constructor after the InitializeComponent call. You'll need to set the StartPosition to Manual.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
DaveyM69 wrote: forget about the maximized start up state and set the size of the form manually (and the location).
this.Location = new Point(0, 0);
this.Size = Screen.PrimaryScreen.WorkingArea.Size;
I can't believe I didn't think of that!
Thanks very much.
|
|
|
|
|
1 ) I want a function to wait in thread of onbefore unload event for sometime. Can any one tell me how to do it in javascript.
2) Is it possible to make visibility of showmodaldialog window to false or move it away from the screen ?
Thanks in advance
|
|
|
|
|
You have been a member of CodeProject for a year and yet you post a javascript question in the C# forum, hmmm interesting.
led mike
|
|
|
|
|
I'm not sure if this is the correct place to ask this question. Sorry if I post in the wrong forum. I have created a POS system for restaurant using C# express and SQL Server express. I want to extend the application, so my client can take orders with PDA. I have think some ways, creating mobile application with C# or create an ASP.NET, or maybe PHP application accessing SqlServer. I am not familiar with PHP but not ASP.NET. So what do you suggest I should be using? Is it posible using C# express creating mobile app? If I should create mobile app, where should I start. Thanks.
|
|
|
|
|
I'm not entirely sure, but I don't think the license for C# Express permits you to sell software you create with it. I think it's more of a learning tool. If you can, then I'm happy because I've been working under a complete misconception. If you want to create mobile Apps, I believe SharpDevelop will let you do that, I think they've brought that piece of software along quite a bit.
I personally would go the route of creating a mobile app, but that way you're going to have to write client/server software to interface with your POS database. Going the webserver route, all your code is server-side, you just interface with the database on the server side and your handheld just has a webpage open. Designing a webpage that will work well on the handheld will be a bit tricky, and you'll also need to lock down wireless quite tightly.
|
|
|
|
|
You can use the Express editions for commercial use. I raised the same point with someone else a while ago (can't find the thread now!), but I researched it a little and had to correct myself!
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Found the post
Clickety[^]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Mobile apps are much the same as any ordinary app and C# will do it very nicely. Not sure if you can do mobile apps on Express though - does it have the emulator?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
hi,
i would like to know how can i do?
i want to access all computer through my computer and response.
i want that my page shows on client machine then client cant do any thing with out answering that. while already connected to lan.
how can i made cybercafe software?
advance thanks.
|
|
|
|
|
Err... Well, you could have one computer with a direct connection to the internet that all other computers connect to. The other computers on the network would have to connect to this machine so you could control from there what they get. Depending on how large the network is, you might need one meaty computer, or just set up a small server.
As for the code part, you'd need to make a server application to accept any incoming requests and send back the webpage / information you need to. There are countless articles and examples of making a server application here on CP and the rest of the internet, so you should read through some of those.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
Hy everyone!
I know there is a c# operation, to watch a directory for changes, meaning to realize, when files are copied into it to handle them etc.
this could be done by filesystemwatcher (FileSystemWatcher watcher = new FileSystemWatcher(); )
but in which order are the files which are found in this directory handled? in alphabetical order or just picking one?
so lets say i copy three files to this directory
b_file, a_file and c_file in which order are these files handled?
and lets say there is already a d_file in it when i start the service watching, which files comes first?
because i want to realize a tool which takes the files describing what to do (in xml). so the correct order is important. therefore i have to know the files are handled in the correct order.
let's say a_file creates a file, b_file changes the contence and c_file copies it to it's destination.
so the "commandfiles" have to be handled in correct order. that's why this info is so important for me.
thanks for any hint.
stephan.
|
|
|
|
|
The files will be handled in the same order as the IO operations.
Note you won't get any events for files that were already in the folder before the FileSystemWatcher is started (d_file)
|
|
|
|
|
so this means, when a file enters the directory, then the trigger is started.
if file a_file and b_file enter at (almost) the same time, is a_file handled first or the one which is first in?
to guarantee the correct handling of the files i have to take care, a_file is there before b_file etc. is this correct?
because changing contence before creating a file won't work or updating data which is not there because the last command should have put the data in there
thanks for your info.
stephan.
|
|
|
|
|
stephan_007 wrote: if file a_file and b_file enter at (almost) the same time, is a_file handled first or the one which is first in?
It handles the first one in first.
If the order is important then wait until you get a full set in before starting processing - until you have them all you can't do anything anyway, as far as I can tell from your posting.
Bob
Ashfield Consultants Ltd
|
|
|
|