|
Hi
Thank you for ur response,
actually that Data contains multi records.
I think this is one type of csv file,but seperated fields with pipe symbol.
field and value contains side by side.
please give me any solution.
Thanks&Regards
RENU
|
|
|
|
|
I do not think anybody can help you with this. I suggest you to separate the file into individual records and fileds first. Yuo may use the String.Split() method for that purpose. Then you must find out what structure the file has. You should create the XML datatype and finally you can parse the data and convert it to XML. Don't expect us to do this for you.
|
|
|
|
|
Thank you for your response,actually that data belongs to single record it contains 636 fields,then how can we parse the pipe symbols.can u send any sample code.
Thanks&Regards
RENU
|
|
|
|
|
Cheers,
Vikram.
"But nowadays, it means nothing. Features are never frozen, development keeps happening, bugs never get fixed, and documentation is something you might find on wikipedia."
- Marc Clifton on betas. Join the CP group at NationStates. Password: byalmightybob
|
|
|
|
|
Hello All,
I need to find out if mouse is present over any control, say a button.
Please tell me how can I proceed on with this.
Keshav Kamat
India
|
|
|
|
|
one way to do it
u should write code in every control's MouseEnter event.
|
|
|
|
|
|
i wanna to make aprogram that can draw (ellips , line,..) but i have problems with the save & open ..thats apart of the code:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
namespace graphics_practis
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button line;
private System.Windows.Forms.Button square;
private System.Windows.Forms.Button circle;
private System.Windows.Forms.Button ellipse;
private System.Windows.Forms.Button polygon;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button ok;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private BinaryFormatter formtter = new BinaryFormatter();
private FileStream str_reader;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
dr = new draw(this.pictureBox1);
}
static void Main()
{
Application.Run(new Form1());
}
private void menuItem4_Click(object sender, System.EventArgs e)
{
//saving
FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file
Stream streamWriter=new StreamWriter(outStream);
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
//opening
FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file
StreamWriter streamWriter=new StreamWriter(outStream);
}
the error...>>(cannot implicity convert type 'System.IO.StreamWritet'to 'System.IO.Stream'.
|
|
|
|
|
Oh, you're using VS2003. Then WriteAllText is not an option.
mr jets wrote: cannot implicity convert type 'System.IO.StreamWritet'to 'System.IO.Stream'.
You keep posting this, there's no such thing as StreamWritet, is this really not a typo ?
System.IO.FileStream fs = new System.IO.FileStream("c:\\testing.txt", System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
// create a stream writer
System.IO.StreamWriter sw = new System.IO.StreamWriter(fs, System.Text.Encoding.ASCII);
// write to file (buffer), where textbox1 is your text box
sw.Write("text");
// flush buffer (so the text really goes into the file)
sw.Flush();
// close stream writer and file
sw.Close();
fs.Close();
Perhaps the defaults for the params you're not passing in, are not the ones you need ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i reaally appreciat ur time bro..okie ur code creating atext in c drive but it doesnt save the values of (x,y,..) remember bro my program like Paint ..so when i open the text it doesnt display my drawings (line,polygon,..)
thats my open code :
{
OpenFileDialog fileChooser=new OpenFileDialog();
DialogResult result = fileChooser.ShowDialog();
String fileName ; // name of file to containing data
// exit event handler if user clicked "cancel"
if (result == DialogResult.Cancel)
return;
// get specified file name
fileName= fileChooser.FileName;
//show error if user specified invalid file
if (fileName=="" || fileName==null)
MessageBox.Show("Invalid File Name ","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
else
//creat Filestream to obtain read access to file
input = new FileStream(fileName,FileMode.Open,FileAccess.Read);
}
Regards ;
|
|
|
|
|
I'm not sure that I understand. I see you opening a file stream, but I don't see you reading anything, nor does the fact that you read the text have anything to do with seeing polygons ( there's a step in the middle where the text is intepreted to give you the data to show that )
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
thank god u back ..iam soo close to break my pc...u said
(there's a step in the middle where the text is intepreted to give you the data to show that )
can u just tell me what that step..iam baggginngg Christian
Regards ;
|
|
|
|
|
I have no idea. Reading a text file is NOT going to do anything more than put some text into a piece of memory. For that to turn into ellipses, or whatever, you need to write some code that does that.
So, it depends. what is in this text file ? How did it get there ? How did you expect this text to become something on your screen ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Here is the code that does the postback...
string strParm1Val = "grdjo$_ctl1$_ctl6";
string strParm2Val = "";
string strPage = "http://somepage.com/frmjosearchp.aspx?GUID=www&keyword=&FOFID=400194";
string strData = "";
frd.Controls["resultsRichTextBox"].Text = "LOADING PAGE....";
byte[] buffer = Encoding.ASCII.GetBytes(strParm1Val + "&" + strParm2Val);
//Init
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create(strPage);
//Our method is post, otherwise the buffer (postvars) would be useless
WebReq.Method = "POST";
//We use form contentType, for the postvars.
WebReq.ContentType = "application/x-www-form-urlencoded";
//The length of the buffer (postvars) is used as contentlength.
WebReq.ContentLength = buffer.Length;
//We open a stream for writing the postvars
Stream PostData = WebReq.GetRequestStream();
//Now we write, and afterwards, we close. Closing is always important!
PostData.Write(buffer, 0, buffer.Length);
PostData.Close();
//Get the response handle, we have no true response yet!
HttpWebResponse WebResp = (HttpWebResponse)WebReq.GetResponse();
//Let's show some information about the response
Console.WriteLine(WebResp.StatusCode);
Console.WriteLine(WebResp.Server);
//Now, we read the response (the string), and output it.
Stream Answer = WebResp.GetResponseStream();
StreamReader _Answer = new StreamReader(Answer);
strData = _Answer.ReadToEnd();
_Answer.Dispose();
//Console.WriteLine(_Answer.ReadToEnd());
//update controls on other forms
frd.Controls["ResultstextBox"].Text = strData;
frd.Controls["resultsRichTextBox"].Text = strData;
Uri siteUri = new Uri((string)strPage);
webBrowser1.Url = siteUri;
|
|
|
|
|
good morning ..every one !
ok..i wanna to make aprograme that can draw(ellipse,lines,..) but i have aproblems with saving & opening file ..my save code is:
FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file
StreamWriter streamWriter=new StreamWriter(outStream);
the error...>>(cannot implicity convert type 'System.IO.StreamWritet'to 'System.IO.Stream'.
plzz send me back...as fast as u can
Regards;
|
|
|
|
|
mr jets wrote: as fast as u can
I recommend not saying things like this when asking for free advice.
System.IO.File.WriteAllLines or System.IO.File.WriteAllText are the easiest way to create a text file.
Having said that, your code compiles just fine here. What line gives the error ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok frist of all ..iam sorry bout my behavior but save & open its apart of very very huge program ..the dead line after 5 hours..so thank god i didnt kill my some one ..
ok the error at ...:
StreamWriter streamWriter=new StreamWriter(outStream);
plzz if u know more simple code..i will invite u to cinema..kidding!!
|
|
|
|
|
Building the string and using WriteAllText is definately simpler.
I don't get the error, because, like I said, it compiled fine here.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
and using WriteAllText is definately simpler..iam not familiar with that..how will be the code look like..?!
|
|
|
|
|
ok i give up ..i really need ur help bro..its apart of my code..where is the wrong ?!
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
namespace graphics_practis
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button line;
private System.Windows.Forms.Button square;
private System.Windows.Forms.Button circle;
private System.Windows.Forms.Button ellipse;
private System.Windows.Forms.Button polygon;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button ok;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem menuItem5;
private BinaryFormatter formtter = new BinaryFormatter();
private FileStream str_reader;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
dr = new draw(this.pictureBox1);
}
static void Main()
{
Application.Run(new Form1());
}
private void menuItem4_Click(object sender, System.EventArgs e)
{
//saving
FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file
Stream streamWriter=new StreamWriter(outStream);
}
private void menuItem3_Click(object sender, System.EventArgs e)
{
//opening
FileStream outStream=File.Create(saveFileDialog1.FileName);//To create text file
StreamWriter streamWriter=new StreamWriter(outStream);
}
|
|
|
|
|
Am I going mad? Is there a control just for integer or decimal values?
I have a form that is purely based on "controls" for decimal that result in Un-Editable "controls" as decimal results.
The thing that concerns me is the amount of casting/parsing I am doing. Taking a text entry, parsing to decimal, doing my math then parsing back to decimal again to show in the results box.
There is the numeric up/down control. But can you remove the up/down part of it to use it as a purely numeric control?
Much appreciated
Tony
|
|
|
|
|
No, you can't. You can create a text box derived class that only accepts numbers and encapsulates the parsing, that's as good as it gets.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have the following string "1100" (or any string of size N with N/2 '1' followed by N/2 '0). I want to make a function that returns all the possible arrangements of "1100" for example:
1100
1010
1001
0110
0101
0011
How would I go about doing this?
I love to program!
|
|
|
|
|
Try This:
create the following functions:
===============================
1.string arraytoString(int [])
This function must combine the array into string.
2.int countOnes(int [])
This function must count the number of "ones" present in the array.
3.int [] convertToBinary(int n,int s)
This function must convert the integer n to its binary equivaling and split them into an array of size s.
Ex: input:8,5 output: {0,1,0,0,0}
4.mainfunction()
{
for(int i=0;i<2<sup>N</sup>;i++)
{
int a[]=convertToBinary(i,N);
if(countOnes(a)==N/2)
print arraytoString(a);
}
}
Regards,
Arun Kumar.A
|
|
|
|