|
Is there any way to convert HTML content to plain text.
I want simple/plain text present in HTML content.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:06am.
|
|
|
|
|
i read that article and its really helpful.
My another question related to same issue.
instead of converting, is it possible to make richtextbox able to understand HTML.
like when we open open a file in IE(web browser).
Does same can be achieve for richtextbox control?
Its a window application.
|
|
|
|
|
Hi Experts.,
I m using datetimepicker.when i retrive the value of date from grid it comes correctly in my string var i.e dd/mm/yyyy.But when i assign it to dtp.Text it gets displayed in mm/dd/yyyy
Sharing Of Knowledge Provides Solution....
|
|
|
|
|
I am using:
<br />
foreach (DebtorDataSet.PaymentArrangementsRow row in debtorDataSet.PaymentArrangements.Rows)<br />
{<br />
if (row.PaymentArrangementID != -1 && row.PaymentTypeID == Convert.ToInt32(paymentCategoryComboBox.SelectedItem) && row.ArrangementComplete == false)<br />
{<br />
row.ArrangementComplete = true;<br />
row.ArrangementDate = DateTime.Today;<br />
}<br />
}
but this is giving me the error:
'Unable to cast object of type 'System.Data.DataRowView' to type 'System.IConvertible''
I am not sure how to correct this.
Any help would be much appreciated please.
|
|
|
|
|
I'm not really sure about it, but because there is only one line where you convert something I would
replace
Convert.ToInt32(paymentCategoryComboBox.SelectedItem)
with
Convert.ToInt32(paymentCategoryComboBox.SelectedItem.ToString())
But in general SelectedItem is not from the type 'System.Data.DataRowView' so I'm a little
bit confused with it. But maybe that helps.
Greetings
Covean
|
|
|
|
|
Many thanks for your reply.
Sill me realised that I needed SelectedValue instead of selectedItem to do the job.
The perils of late night coding .......
|
|
|
|
|
Hehe.
On the other hand its sometimes very funny to look over code you wrote in a stressful time.
Sometime its a bloomer just for the Coding Horrors section.
Greetings
Covean
|
|
|
|
|
What type is the SelectedValue?
If it's an int, why convert an int to an int? Just cast it.
If not, then you can probably cast it anyway.
I find the Convert class to be nearly entirely useless; try not to use it.
|
|
|
|
|
Dear All,
I am making a project using ASP.Net and C#.
I have a text box where i enter the amount. What i want is that when the user goes to the next field, i want the amount to the formatted in the following way:
For example, if the entered amount is 100000; i want it to be formatted as
Rs. 1,00,000.00
This Rs. is for Indian Rupees. This can be US Dollors or Euro also.
Request your help please.
Thanks
Sajit
modified on Wednesday, November 11, 2009 4:14 AM
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:17am.
|
|
|
|
|
Is there any other method of doing this.......
please advise
Thanks / Sajit
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:04am.
|
|
|
|
|
I have never created a masked text box. Can you help me in creatng it for this purpose. This is a web application.
It would be great if help is provided.
Thanks / Sajit
modified on Wednesday, November 11, 2009 6:00 AM
|
|
|
|
|
hi all,
I need to know How to edit and manage group policy through C# and ASP.Net application.I want to get all users an groups in the active directory and I already did this.I then want to assign group ploicy to groups and OU(organizational unit).
I&S
|
|
|
|
|
This question isn't really answerable is a forum environment. The description of everything you ahve to do would be a larger article or a small books worth. Far beyond the capacity of a few forum posts. All I can do is direct you to start researching the System.DirectoryServices namespace to get an understanding of the classes you're going to use to manipulate Active Directory. From there, you can come up with a design for your ASP.NET app.
|
|
|
|
|
Thanks Dave Kreskowiak
I searched for Active Directory services and read a book about it and the group policy(GPO scripting of it).
|
|
|
|
|
Hello
My problem is updating multiple rows of a single column with different using update command from C#
Regards Usman Ahmad
|
|
|
|
|
Would you care to actually explain the problem and the code you're using or should we just guess at the million or so possible issues you have?
|
|
|
|
|
Thanks to every one who replied me. I have solve the problem.
regards
Usman Ahmad
|
|
|
|
|
Hi Guys,
i need the NewRowNeededEvent of the DataGridView. So i set the VirtualMode Property to true.
But if this property is set to true, i need to set the cell value by myself, otherwise it vanisches if i leave the cell.
So i've tried to save the value - the cell is a ComboBox where i select a value - in the CellValidatinEvent.
But it doesnt work. The value property of the cell is not changing it is still null.
Here is some code that you can understand what i mean.
<br />
<br />
private void aufwandDataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)<br />
{<br />
DataGridViewComboBoxCell cell =<br />
aufwandDataGridView.CurrentCell as DataGridViewComboBoxCell;<br />
<br />
cell.ReadOnly = false;<br />
<br />
if (aufwandDataGridView.IsCurrentCellDirty)<br />
{<br />
<br />
aufwandDataGridView.CommitEdit<br />
(DataGridViewDataErrorContexts.Commit);<br />
}<br />
<br />
cell.Value = e.FormattedValue;<br />
}<br />
Can anyone please help me?
Kind regards and thx in advance
Me
|
|
|
|
|
Ok it's because of the VirtualMode property that i can't set the cell.value so easily.
But how can i set the cell.value if the cell is not databound?
|
|
|
|
|
Ok i've given up on virtual mode.
now i search for an event that occurs at the same time like newrowneeded
|
|
|
|
|
hi
at first excuse me because of my poor english i have written a program for sending an image or for video conference via internet with sockets and i am using tcp protocols my problem is that when i test program on my computer it works fine but when i test it over internet with between two pcs the reciver cant recieve image correctly minwhile i am using dial up
connection i dont know where is the problem perhaps it is because of low speed of internet i changed the buffer size to 512 1024 4096 and it didnt change. or i maybe should compress or encode image i dont know .please please help me with this problem.
here is the code for sending an image :
private void button2_Click(object sender, EventArgs e)
{
byte[] bytes;
using (MemoryStream ms = new MemoryStream())
{
pictureBox1.Image.Save(ms,ImageFormat.Jpeg);
pictureBox2.Image = pictureBox1.Image;
bytes = ms.ToArray();
ms.Close();
}
startcapturing(bytes);
}
private void startcapturing(byte[] bytes)
{
int i = 0;
byte[] dataBuffer = new byte[128];
int index = 0;
byte[] loop = new byte[128];
loop = System.Text.Encoding.ASCII.GetBytes(((bytes.Length / 128) + 1).ToString());
label4.Text = ((bytes.Length / 128) + 1).ToString();
if (serverSocket != null)
{
try
{
rc = clientSocket.Send(loop, SocketFlags.None);
while(i<bytes.length)
{
="" for="" (index="0;" index="" <="" databuffer.length;="" index++)
="" if="" (i="">= bytes.Length)
{
dataBuffer[index] = 0;
}
else
{
dataBuffer[index] = bytes[i];
i++;
}
}
rc = lientSocket.Send(dataBuffer,SocketFlags.None);
}
}
catch (Exception err)
{
MessageBox.Show(err.Message.ToString()+"here");
}
}
}
here is the code for client to recieve image:
if (clientSocket != null)
{
while(true)
{
while (true)
{
int counter = 0;
msr = new MemoryStream();
byte[] recv = new byte[128];
try
{
rc = clientSocket.Receive(recv, SocketFlags.None);
try
{
counter = Convert.ToInt32(System.Text.Encoding.ASCII.GetString(recv, 0, recv.Length));
}
catch { }
while (counter > 0)
{
rc = clientSocket.Receive(recv, SocketFlags.None);
counter--;
msr.Write(recv, 0, recv.Length);
}
}
catch (Exception e)
{
}
try
{
pictureBox1.Image = Image.FromStream(msr);
msr.Close();
}
catch(Exception e)
{
}
break;
}
}
}
else
{
StatusLabel1.Text = "Unable to establish connection to server!";
BtnDC_Click(null, null);
}
}
i beg you help me
|
|
|
|
|
I don't understand the full code, but I must say the problem is probably with the send or the Receive.
I am not sure if the Send can send partial data, but receive surelly do.
For example: You send 128 bytes.
The connection is local, you get 128 bytes.
But, if the connection is remote, you can:
Receive 10 bytes.
Then, receive 20 bytes.
+ 10 bytes... until you finally receive all the buffer (the 128 you expected).
So, you must check this.
Also, I think a better approach is:
Instead of writing everything to a memorystream and them sending the memorystream buffer, get the socket stream (socket.GetStream()) and save the image directly to the socket stream.
Then, on the other side, call Image.FromStream(socket.GetStream())
|
|
|
|