|
ASCII characters are what they are - 7bit characters using codepage 0x4E9F. You can specify a different ANSI code page using Encoding.GetEncoding to specify a code page that contains the character about 127 you want.
The characters above are in the 1250 code page (Western European) so you could use new StreamWriter(m3uFileName, true, Encoding.GetEncoding(1250)) and specify those characters in source as \xe5, \xe4, \xf6, etc.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Tnx. That was what I needed. I only needed to change 1250 code page into 1252 code page and now my application run fine.
If any want to use the 1252 code page take a look here http://www.kostis.net/charsets/cp1252.htm
|
|
|
|
|
Do anybody know how to plot points on a user form I have created?...
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication7
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.GroupBox groupBox1;
///
/// 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
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(48, 112);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 32);
this.button2.TabIndex = 1;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(160, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(88, 20);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(160, 112);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(88, 20);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "textBox2";
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(24, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 224);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox2,
this.textBox1,
this.button2,
this.button1,
this.groupBox1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = Convert.ToString(2*2);
}
private void button2_Click(object sender, System.EventArgs e)
{
textBox2.Text = Convert.ToString(2*2^3+10);
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
}
}
|
|
|
|
|
X and Y are array list.
Bitmap objBitmap;
Graphics objGraphics=Graphics.FromImage(objBitmap);
if(X.count==Y.count)
{
for(int i;i<= X.Count - 1 ;i++)
{
objGraphics.DrawRectangle(new Pen(new SolidBrush(Color.Red)),Convert.ToInt32(X[i]),Convert.ToInt32(Y[i]),2,2);
}
}
U can take help for this example.
|
|
|
|
|
Can anybody fix this problem??
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication7
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.GroupBox groupBox1;
///
/// 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
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(48, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(48, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(48, 112);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(48, 32);
this.button2.TabIndex = 1;
this.button2.Text = "button2";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(160, 56);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(88, 20);
this.textBox1.TabIndex = 2;
this.textBox1.Text = "textBox1";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(160, 112);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(88, 20);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "textBox2";
//
// groupBox1
//
this.groupBox1.Location = new System.Drawing.Point(24, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 224);
this.groupBox1.TabIndex = 4;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox2,
this.textBox1,
this.button2,
this.button1,
this.groupBox1});
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
}
#endregion
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
textBox1.Text = Convert.ToString(2*2)+ RAND();
}
private void button2_Click(object sender, System.EventArgs e)
{
textBox2.Text = Convert.ToString(2*2*3^22);
}
private void Form1_Load(object sender, System.EventArgs e)
{
}
// Array of co-ordinates to be plotted
array = [12,23,33,21];
// Plotting loop?
if(X.count==Y.count)
{
for(int i;i<= X.Count - 1 ;i++)
{
objGraphics.DrawRectangle(new Pen(new SolidBrush(Color.Red)),Convert.ToInt32(X[i]),Convert.ToInt32(Y[i]),2,2);
}
}
}
}
|
|
|
|
|
hi
this is part of the code causing the problem:
XmlNodeList l = outputcopy.SelectNodes("//" + tagname);
foreach (XmlNode nod in l)
{
XmlNode parent = nod.ParentNode;
if (parent == null)
{
//break here
}
}
Whenever I try this the last node in the node list appears not to have a parent, even when its not the root node. Whay is this?? I'm totally stumped.....
cheers
|
|
|
|
|
It would be helpful to see the Xml file that you're querying in order to figure out what's wrong...
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Sorry, the xml is:
<xml>
<multiply>
<variable name="x" />
<variabel name="x" />
</multiply>
<symbol>=</symbol>
<multiply>
<number>2</number>
<number>5</number>
</multiply>
</xml>
and tagname is "multiply"
cheers
|
|
|
|
|
|
Hi,
maybe somebody know how i can read IPTC from image file?
Greetings
|
|
|
|
|
Hi everybody!
I have a question to do:
how can i download the HTML code of an internet page, and save it in .txt?
help me plz...
|
|
|
|
|
|
i need the code of an internet page i put in input...all ways are allowed!
|
|
|
|
|
Your browser does that - only it renders it. You can, in your browser, select "File -> Save As" and save it as an HTML page, then open it up in a vanilla (plain) text editor.
If you want to do this programmatically, see the example in the documentation for the HttpWebRequest.GetResponse[^] method. Just save it to a file instead of using the Console .
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thank You very much Mr. Heath Stewart!
Exactly i needed!
Thank You again
Enricop
|
|
|
|
|
You can also use RegEx to strip the html tags from the response.
<br />
public string cleanHtmlTags(string inputText)<br />
{<br />
Regex objRejex = new Regex("<([^>]*?)>");<br />
return objRejex.Replace(inputText, "");<br />
}<br />
"If knowledge can create problems, it is not through ignorance that we can solve them." -- Isaac Asimov
|
|
|
|
|
I have a web page with dynamically geneated textboxes and buttons. On click of a button, I want to pull the values from the database and populate the textboxes. I am gettinng confused between the sequence in which the client and server side code gets called. If I call server side first and then client, practically it happens in opp order . For eg-
TableCell tblCell5 = new TableCell();
System.Web.UI.WebControls.Button btn = new System.Web.UI.WebControls.Button();
btn.Text = "Copy";
btn.ID = "btnFetch"+ count.ToString();
counter = count;
btn.CommandArgument = count.ToString();
btn.Command += new CommandEventHandler(RemoveFiles);
btn.Attributes.Add("onclick","setit(" + count + "," + crash +","+ cr +","+ cav+"); ");
tblCell5.Controls.Add(btn);
tblRow.Cells.Add(tblCell5);
Even if I call in this order and set the values of variables in RemoveFiles, the javascript functions gets called first and by that time, the variables are not set.
Also if I try to call javascript from server side function, he javascript function is not yet loaded. For eg-
protected void RemoveFiles(Object sender, CommandEventArgs e)
{
stag = 1;
Response.Write(" alert("+ e.CommandArgument.ToString() +")");
cr = 6;
cav = 9;
hrs=10;
crash = 6;
Response.Write(" setit(' + count + ',' + crash +','+ cr +','+ cav+'); ");
}
Any suggestions?
|
|
|
|
|
I have added a button and a text box onto a form with no methods within the form...I would like to click the button and perform a simple formula of 2*2 and output the answer to the textbox?..just to get me started!
any Ideas Thanks..
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication2
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox textBox1;
///
/// 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
//
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(64, 56);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(72, 32);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// groupBox1
//
this.groupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.textBox1});
this.groupBox1.Location = new System.Drawing.Point(16, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 240);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "groupBox1";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(56, 120);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(56, 20);
this.textBox1.TabIndex = 0;
this.textBox1.Text = "textBox1";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.groupBox1});
this.Name = "Form1";
this.Text = "Form1";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
//Draws the image to fit the ClientRectangle area of the form.
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
}
}
}
|
|
|
|
|
private void button1_Click(object sender, System.EventArgs e)
{
TextBox1.Text = Convert.ToString(2*2)
}
|
|
|
|
|
Cheers How do you implement a for loop in c# ?
Thanks Jay
ps cheers for your help!!
|
|
|
|
|
the same way as c/c++/java
for (int i = 0;i<10;i++)
{
}
you really need to eitehr buy a book, or google yourself a decent tutorial though.
|
|
|
|
|
How to capture 'editing whichever cell in datagrid' event? And how to recover number of row and column cell that has just been edited?
thank you for help
|
|
|
|
|
I'm returning a datatable from the DB, I need to add a row to that datatable for display only. That piece is working fine, the issue is I need that record to be the first record displayed in the cbo box.
System.Data.DataRow dr = WorkTable.NewRow();
WorkTable.Rows.Add(new object[] {"ALL", "AL","","","","","","",-2,1,"UNKNOWN"});
cbo.DataSource = WorkTable;
--I need to have the added line first in the combo box.
Thanks
|
|
|
|
|
Instead of setting the data source of the combobox to the table, set it to a sorted view. Then all you need to do is make sure that the view is sorted so that your new row is first ... perhaps by adding a new column to the table that is null for everything other than your new row. I tried this quickly, and seems to work OK, but it looks like the sort put's null values ahead of non-nulls, so you'll need to do a descending sort.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
We have an app that will not run on a single computer from the network (works fine locally). I have adjusted .NET security setting the Local Intrenet to Full Trust, but the app still crashes when trying to launch.
Any other ideas?
|
|
|
|
|