|
thanks
the quieter u become more u hear
|
|
|
|
|
Hi,
if you don't actually need the array and just want to enumerate the characters in a string
(without changing them!) you can do:
string myString="Some string";
foreach (char myChar in myString) {
Console.WriteLine("myChar="+myChar);
}
PS: please read my signature, I changed it after reading your recent posts.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 12:03 PM
|
|
|
|
|
Luc Pattyn wrote:
PS: please read my signature, I changed it after reading your recent posts.
People like him don't care about such advice
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi, Can anyone help me with this code:
IHTMLDocument2 HTMLDocument = (IHTMLDocument2)axWebBrowser1.Document;
IHTMLElementCollection All_ = HTMLDocument.all;
IHTMLElement el_;
for (int r = 0; r < All_.length - 1; r++)
{
el_ = All_.item(r, 1) as IHTMLElement;
if (el_.isTextEdit)
{
listBox2.Items.Add("id = ");
}
else
{
listBox2.Items.Add("id = " + el_.id + " tagname = "+el_.tagName);
}
}
My problem is that el_id is empty. What am I doing wrong ?
The problem I try to solve is that my website is loading htmlcode from a database and has to send it to the browser. But before it is sent I need to check all the tag values (input type = text and select id = something and so on) and put some default value in it, so it is displayed in the clients browser. The problem is that I dont know what the html contains, it can contain any valid html code, that my app has to check and handle
Best Regards
FaroePigBear
|
|
|
|
|
Error found... no id tags was in the html, only name was specified
when changing:
<input type="text" name="date_from"
to:
<input type="text" id="date_from"
then the el_id contain date_from so it works now.
But however I have a new problem when setting the value of the tag.
If I run this:
element.setAttribute("value", "new value",0);
then it sets all value on my page. I guess it should be possible to write:
element.setAttribute("date_from", "new value",0);
.... but that does not work.
How can I set a value on only one text input tag´s id ?
Best Regards
FaroePigBear
|
|
|
|
|
if possible antbody help me... do no wat error it contains
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MainClass
{
public static void Main()
{
int tokenindex = 0;
int cntTokens = 0;
int iSymbol = -1;
int prevDictSymbol = -1;
char[] strToken = new char[512];
int i=0;
string[] arr = { "Hello", "World" };
while (arr[0] != null)
{
tokenindex = 0;
while ((arr[0] != ' ') && (arr[0] != ',') && (arr[0] != ';')
&& (arr[0] != '/') && (arr[0] != '#') && (arr[0] != '\0')
&& (arr[0] != '&') && (arr[0] != '-'))
strToken[tokenindex++] = arr[0];
arr++;
strToken[tokenindex] = '\0';
}
Console.WriteLine(" The Token is:", strToken);
Console.WriteLine("The Length of strToken", strToken);
}
}
the quieter u become more u hear
|
|
|
|
|
What sort of error? Compiler error? Not the data you excepted?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
hmmm.. compiler error
the quieter u become more u hear
|
|
|
|
|
Okay, looks like you actually don't want help.
modified 12-Sep-18 21:01pm.
|
|
|
|
|
his footer says
"
the quieter u become more u hear
"
he's absolutely right: don't give all the info too soon
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
It's probably because all your code is in bold and not formatted correctly for review.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
If you can't see the problem, you really need to drop the C# class your taking right now. Intellisense lights that code up like a freakin' Christmas tree.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
BTW, this is the most frakked up homework assignment on the planet. Does your instructor really want you to use a character array to hold the extracted word?
I rewrote your code so that it would work, but I don't know if I want to give it to you because it has the very real possibility of helping you pass the course, and I don't think we need another clueless programmer running around writing crappy code.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Please nooo not another clueless programmer! there are enough in the world at the moment, can we put them all in one place and just push the barge away so they float away out of harms way.. preferablly with no internet connection
|
|
|
|
|
Well in amongst all the flames and elitist comments. I'll assume your a complete n00b and help you out a bit. but I gotta be honest, it was glaringly obvious.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class MainClass
{
int tokenindex = 0;
int cntTokens = 0;
int iSymbol = -1;
int prevDictSymbol = -1;
char[] strToken = new char[512];
int i=0;
string[] arr = { "Hello", "World" };
public static void Main()
{
while ((arr[0] != null)&amp;(arr[0]!= ' ')&&(arr[0] != ',')&amp;(arr[0] != ';')&&(arr[0] != '/')&&(arr[0] != '#')&&(arr[0] != '\0')&&(arr[0] != '&')&&(arr[0] != '-'))
{
tokenindex = 0;
strToken[tokenindex++] = arr[0];
arr++;
strToken[tokenindex] = '\0';
}
Console.WriteLine(" The Token is:", strToken);
Console.WriteLine("The Length of strToken", strToken);
}
}
aaarghhh! too many ands. That's as much am I'm going to do, the rest is up to you.
<div class="ForumMod">modified on Monday, January 26, 2009 2:51 PM</div>
|
|
|
|
|
I am using crystal reports in my project. Every thing is fine but when i am trying to export report into any other format it gave me an error "LOAD FILE FAILED". Please help me how i can resolve this error.
I am using VS2008, Crystal Report 10 and sql2005
thanks
|
|
|
|
|
|
|
This creates a circular PictureBox, I'm sure you can adapt it to suit.
PictureBox CreateCircularPicture(Image image)
{
PictureBox pictureBox = new PictureBox();
float smallestDimension = image.Width;
if (image.Height < smallestDimension)
smallestDimension = image.Height;
System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
myGraphicsPath.AddEllipse(0, 0, smallestDimension, smallestDimension);
pictureBox.Region = new Region(myGraphicsPath);
pictureBox.Image = image;
pictureBox.Height = (int)smallestDimension;
pictureBox.Width = (int)smallestDimension;
return pictureBox;
}
Controls.Add(CreateCircularPicture(Image.FromFile(@"C:\background.jpg")));
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
I Have this error at when i try to edit the row
|
|
|
|
|
You need to use SelectedIndex remembering that a listbox is zero based so SelectedIndex(0) would be the first item in the list and SelectedIndex(10) would be the ninth item in the list.
|
|
|
|
|
hi evryone
i have some unsolve problem in C#
1. how can i print picture in crystal report (from imag type in database)
2. how can i send and resive List<> to function ?
3. how can i change date format in WinCE (for ex. en-US)
thank's for any help
|
|
|
|
|
1 - Load it into a byte array. Crystal report can render it as image.
2 - Do you mean this?
List<Foo> AcceptAndReturnListFoo(List<foo> foo){
}
|
|
|
|
|
When I open a page in the
WebBrowser I see appear notice board:
Security information .Toi want programmed to automatically remove this notice I do? I'm using language C #. NET
|
|
|
|
|
Hello everyone,
I'm developing an application that is similar to Windows Explorer. I'm using a ListView control to display files and folders along with their icons. Now, icons for files can be retrieved using standard shell functions ExtranctIcon and ExtractIconEx. But my question is that how can I get that translucent effect as used by Windows Explorer for hidden and system files.
I searched google and found the following code snippet:
public static Image SetImageOpacity(Image imagePic, float imageOpacity)
{
Bitmap bmpPic = new Bitmap(imagePic.Width, imagePic.Height);
Graphics gfxPic = Graphics.FromImage(bmpPic);
ColorMatrix cmxPic = new ColorMatrix();
cmxPic.Matrix33 = imageOpacity;
ImageAttributes iaPic = new ImageAttributes();
iaPic.SetColorMatrix(cmxPic, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);
gfxPic.DrawImage(imagePic, new Rectangle(0, 0, bmpPic.Width, bmpPic.Height), 0, 0, imagePic.Width, imagePic.Height, GraphicsUnit.Pixel, iaPic);
gfxPic.Dispose();
return bmpPic;
}
Now my code calls this method as follows:
lViewVFSBrowser.LargeImageList.Images.Add(imageKey, SetImageOpacity(iconL.ToBitmap(), (float)0.7));
but all I get in return is an icon with a bluish background as shown here:
http://www.geocities.com/ankit_incredible_2006/problem.JPG[^]
|
|
|
|