|
Hi guys =)
Just drag in a ListBox & copy/paste this piece of code & run.
<br />
for (int i=0; i<50; i++)<br />
{<br />
listBox1.Items.Add("");<br />
TextBox tx = new TextBox();<br />
tx.Location = new Point(0,i*20);<br />
listBox1.Controls.Add(tx);<br />
}<br />
Now scroll the listbox as fast as u can. Items disappear! That's on XP ofcourse.
Anyone can help?
-- modified at 8:55 Tuesday 11th October, 2005
|
|
|
|
|
your code has no problem... i think it's the version of the OS...
dude... we know all microsoft is good all the times.. but extremely bad sometimes (taking consediration of your copy.. is it trusted copy or not?)... so don't worry ... if you want to check out your program... run it in another machine, with another Version
Militiaware
|
|
|
|
|
Hi,
I'm trying to get a regex pattern that will match any URLs in some text but *not* email addresses:
Eg: Given the following text...
Visit us on the web under Career Opportunities www.site1.com or email your enquiry to mike@site1.com. To obtain a copy of our position description go to http://www.site2.com or http://site3.com
... I'd want to get the three URLs but *not* the domain of the email address... I've tried and tried with all sorts of regex patterns but can't get this working... can anyone help me out on this one?
Cheers, thanks in advance for any help... this will help me hit a big deadline (hopefully!)
Mike
|
|
|
|
|
Hi Mike,
IMO, you can simply classify the URLs in the text into two groups. For ones starting with http:// you can use the pattern:
http: and the pattern:
www.([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)? for others starting with www.
Now you can refine the two patterns to produce a better one that can be used for the two groups:
(http: The sample code looks something like:
private ArrayList ExtractUrls(string s)
{
string pattern = @"(http://|www.)([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?";
Regex r = new Regex(pattern, RegexOptions.Compiled);
MatchCollection matches = r.Matches(s);
ArrayList list = new ArrayList();
foreach(Match match in matches)
list.Add(match.Value);
return list;
}
|
|
|
|
|
Thanks so much for that... this is a project I'm working on in my spare time so will look at it a bit later today.
Cheers,
Mike
|
|
|
|
|
What is IIS?
If I start working on .NET environment then what is basic things about IIS should I know?
what are the basics of IIS?
|
|
|
|
|
IIS is Internet Information Services[^]. In other words, it's a web server.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
First of all you MUST install IIS before the installation of VS.NET
It is necessary for ASP.Net applications which you need a web server.
(1) You can install it from
Start -> Control Panel \ Add Remove Programs \Add Remove windows component
check IIS checkbox
(2) You can use IIS Manager from
Start -> Run \inetmgr.exe
It shows default Web site (C:\Inetpub\wwwroot)
if everything is okey your internet browser can show asp files.
(3) .Net creates and open a virtual directory for your web project under
C:\Inetpub\wwwroot
It is better to know how to create a virtual directory from IIS as a general knowledge (http://www.webwizguide.com/asp/tutorials/installing_iis_winXP_pro.asp)
P.S : If you install IIS after the installation of VS.NET, VS.NET doesn't recognise IIS. Help instructions and ISS diagnostic tools don't help much.
Because of this problem I have to use use VS .Net 2002 for web applications instead of 2003 which doesn't see IIS on the same machine.
|
|
|
|
|
Hi,
I faced one question in my recent interview, i don't know the answer.
What is the size of stack in .net?
anyone knows?
|
|
|
|
|
According to Google[^] the answer is one megabyte.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Thanks.
Yes i think it is true.
|
|
|
|
|
What this code does is let me choose a file, like an article saved in a .rtf file and take the text from that and put it into a .html file. The problem I'm having is in the middle, in the part that writes "the BULK of the content to the new file". It stops writing the writing the content from the .rtf file to the new file after it has written so many characters.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles Button1.Click
Dim openStream As New FileStream(txt_BrowseDP.Text & ListBox_Browse.SelectedItem, FileMode.Open, FileAccess.Read)
Dim makeStream As New FileStream(txt_BrowseDP.Text & ListBox_Browse.SelectedItem & ".html", FileMode.CreateNew, FileAccess.Write)
Dim theReader As New StreamReader(openStream)
Dim theWriter As New StreamWriter(makeStream)
Dim BulkContent As String
'Write the FIRST part of content to new file
Try
theWriter.WriteLine("<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Strict//EN""")
theWriter.WriteLine("""http://www.w3.org/TR/xhtml1/DTD/strict.dtd'"">")
theWriter.WriteLine("<html>")
theWriter.WriteLine("<head>")
theWriter.WriteLine("<title></title>")
theWriter.WriteLine("<meta http-equiv=""content-type"" content=""text/html; charset=UTF-8"" />")
theWriter.WriteLine("<style type=""text/css"" media=""screen"" title=""Default"">@import url(../main.css);</style>")
theWriter.WriteLine("</head>")
theWriter.WriteLine("<body>")
theWriter.WriteLine("")
theWriter.WriteLine("<pre><div</pre> id=""container2"">")
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
'Write the BULK of the content to the new file
Try
theWriter.WriteLine("<p><strong>" & theReader.ReadLine() & "</strong></p>")
While theReader.Peek() > -1
If theReader.ReadLine() <> "" Then
theWriter.WriteLine("<p>" & theReader.ReadLine() & "</p>")
End If
End While
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
'Write the LAST part of the content to the new file and then close
theWriter.WriteLine("</div>")
theWriter.WriteLine("")
theWriter.WriteLine("<p><a href=""#container2"" accesskey=""c""></a></p>")
theWriter.WriteLine("")
theWriter.WriteLine("</body>")
theWriter.WriteLine("</html>")
openStream.Close()
makeStream.Close()
End Sub
-- modified at 19:37 Sunday 9th October, 2005
|
|
|
|
|
Call .Flush() on the stream before you close it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I added theWriter.Flush() and it writes everything now. Thanx.
|
|
|
|
|
You should have called Close on the StreamReader and StreamWriter instead, that way, it automatically flushes AND closes the stream for you.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
crystal reports report
in my Form i Have Sum query like this :
SELECT SUM((Sahar.RegHours * 1 + Sahar.Hour120 * 1.2 + Sahar.Hour125 * 1.25 + Sahar.Hour140 * 1.4 + Sahar.Hour150 * 1.5 + Sahar.Hour175 * 1.75 + Sahar.Hour200 * 2.0 + Sahar.Hour225 * 2.25) * Sahar.MoneyForHour + Sahar.TasNsiot + Sahar.Globaly + Sahar.HefrshySahar + Sahar.Manak - Sahar.HiovMils - Sahar.HiovBigod - Sahar.HiovHanala) AS total, Customers.CustName, Sahar.SalDateStart, Sahar.SalDateEnd, COUNT(*) AS Expr1, Customers.CustAddres, Customers.CustNum, Customers.CustCity FROM Sahar INNER JOIN Customers ON Sahar.CustNum = Customers.CustNum WHERE (Sahar.SalDateEnd >= @Edate) AND (Sahar.SalDateEnd <= @Edate1) GROUP BY Customers.CustName, Sahar.SalDateStart, Sahar.SalDateEnd, Customers.CustAddres, Customers.CustNum, Customers.CustCity
the sum value is changing for every row
i have also a datagrid and the resualt there are good
the problem is when i sending this data to printing in crystal
i dont know how to send the SUM val to the report
is someone here can help me whit that ?
thanks aheed.....
|
|
|
|
|
Hi
I have just finished my first .Net application and am now trying to create a setup project using the VS .net feature.
In the setup I should create some new Registry entries on the target machine which have the installation directory in its value.
My question now is: How can I determine, on which directory the application has been installed? And how can I write then this value into the registry key?
I tried it with the variable "ARPINSTALLLOCATION", but this variable was empty.
Thanks and regards Fredy
|
|
|
|
|
As long as you know how to create the Registry keys in the VS IDE you are in good shape. Create the key, create the value name and then set the value to:
[TARGETDIR]
[TARGETDIR] will be replavced by the app folder.
You can also combine [TARGETDIR] with other strings. You need to be aware that [TARGETDIR] will be replaced by the app install folder with the trailing \ appended.
So, say you want to store the path to your application, for example "MyApp.EXE". Set the value to:
[TARGETDIR]MyApp.EXE
Suppose you user installs to "C:\Program Files\Some Application\". If you create a reg key/value and set the value in your setup to:
[TARGETDIR]MyApp.EXE
then after the setup has run the value will be:
"C:\Program Files\Some Application\MyApp.EXE"
Do NOT do this:
[TARGETDIR]\MyApp.EXE
This will write a value to the registry as:
"C:\Program Files\Some Application\\MyApp.EXE"
Robert
|
|
|
|
|
Hi Robert
Thanks alot for your help. I'll try this as soon as possible.
Regards Fredy
|
|
|
|
|
I wasn't quite sure which forum this should go under, so I put it here.
I, like many others I'm sure, use NDoc to create documentation for my code. This is one great product, but it has one slight drawback. It doesn't document v.2.0 code. The team is working on it.
In the meanwhile I use this little workaround to make NDoc document my V.2.0 projects:
Create a file named NDocGui.exe.config and place it in the NDoc folder (e.g. C:\Program Files\NDoc 1.3\bin\net\1.1).
In this config file you just type:
<configuration>
<startup>
<supportedruntime version="v2.0.50215">
and now NDoc will process the v.2.0 projects. (Supported Runtime Version number should of course be changed to reflect the actual version on your system.)
There is even more good news for VB.Net developers. XML documentation is now supported for v.2.0 projects. Just use ''' (instead of /// for C# projects). This also works with NDoc.
jjrdk
|
|
|
|
|
The XML didn't show up because the browser treated it like HTML, and since it wasn't the browser's renderer just ignored it. You have to remember to either click the "Ignore HTML tags" check box, or manually put in the < and > escape sequences manually.
<configuration>
<startup>
<supportedRuntime version="v2.0.50215" />
</startup>
</configuration>
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
|
How to Get some account's ACLs on a folder?
I want get an account's ACLs on a folder and check the account have specail permission on the folder,for example Read & Write.
I want this is implemented with c# code.
|
|
|
|
|
Hi all,
I am developing painting software for pocket pc using .NETCF. I like to set background for that painting application. I declared one global bitmap variable like this
Bitmap bm = new Bitmap
All images are painted in this bitmap (bm) as shown below.
Graphics.FromImage (bm).DrawLine (new Pen (pnlColor.BackColor), lastPos.X, lastPos.Y, e.X, e.Y);
Now I like to set background for this painted image. I used the following code.
Graphics.FromImage (bm).DrawImage (bmpBackground, 0, 0);
The above code just draws the background image over my painted image. So my painted image is hidden and it shows only the background image. But I like to set the background for my painted image. How to tackle this situation. Thanks in advance.
Regards,
S.Sevugan.
|
|
|
|
|
Does drawing the background first and then drawing the painted image solve your problem?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|