|
Hi,
I have problem this one
Dim url As String="http://www.codeproject.com/"
dim str As string
str= url.Remove(0,7)
I got the string "www.codeproject.com/"
after i want to cut string "/"
so it will be "www.codeproject.com".
But when the url like this "http://www.codeproject.com/about.asp"
I want to get result like this "www.codeproject.com" only please help me.
Socheat
................
|
|
|
|
|
Sounds like you want to either use the built in class that knows how to parse a URL, or use the Split method on the string class, splitting on the / and then grabbing the section you want.
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 )
|
|
|
|
|
What is your answer?
Socheat
................
|
|
|
|
|
If you use the split method of the string class on the URL, you will get a string array and one of those elements will be www.codeproject.com, if you split on the /
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 )
|
|
|
|
|
Hi Socheat,
you can either use a regex or simply use split method with /.
If this is all you want accomplish, I will go with split.
rAm
i Think, i Wait, i Fast -- Siddartha
|
|
|
|
|
Hi
Check this code
string strURL = "http://www.yahoo.com/quick/a.asp";<br />
string strURLremove = strURL.Remove(0,7);<br />
if (strURLremove.IndexOf("/") > 0)<br />
{ <br />
strURLremove = strURLremove.Remove(strURLremove.IndexOf("/"),<br />
(strURLremove.Length - strURLremove.IndexOf("/")));<br />
}<br />
Response.Write("<br>" + strURLremove.ToString());
Read the code in bold font carefully. Hope you are clear with this.
Harini
|
|
|
|
|
Thank you so much, i hope this helpful.
Socheat
................
|
|
|
|
|
hi Socheat
i think u have to use Split() function and the saparator should be "/"
like this,
dim szStr as string= "http://www.codeproject.com/about.asp"
Dim szArr as string()
szArr = Split(szStr,"/",-1)
in szArr(BLABLA) U should get the string like
"www.codeproject.com"
Hope it helps.
Regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
Thanks, i hope this helpful.
Socheat
................
|
|
|
|
|
Relatively new to programming in VB. I am currently writing an application that will use a SQL db. The database itself is pretty small and uncomplicated.
I am able to write the program using the embedded data source features within express, but I need to write this program to use a SQL server database. When I attempt to use the data connection wizards in VB express it will not let me connect to server-based DB's only AttachDBFile.
Is there anyway that I can attach a VB express app to a SQL server db and still use the DataSet designer, table adapters, etc.
I'm not new to programming, but I am new to the .net world. Any help would be greatly appreciated...
Also, I have attempted to find this answer using forum searches and wed searches to no avail. Please forgive me if this answer is posted elsewhere in this forum and please direct me if that is the case.
Thanks!
|
|
|
|
|
DigitOptic wrote: Is there anyway that I can attach a VB express app to a SQL server db and still use the DataSet designer, table adapters, etc.
Not that I know of. The Data Explorer in the Express Editions is crippled compared to the larger editions.
|
|
|
|
|
I was afraid of that answer...
Which version would you recommend?? Standard or Professional?
|
|
|
|
|
|
Looking for a tool to compress my projects EXE file and the DLL it uses. Tool doesn't necessarily need to put all files in 1 total package. I tried Netz but for some reason this gives errors and I can't figure out which DLL is causing the problem.
I wouldn't mind if I need to compress the DLL files individually.
|
|
|
|
|
Winzip ? Or are you hoping to create a smalle file, which also still runs ? Try removing/reducing the size of resources in your files.
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 )
|
|
|
|
|
Some of the DLL's I'm using are rather big so I want to shrink them but still be able to run the app.
|
|
|
|
|
The only way to do that is to have things compressed and then decompressed within your app itself. What sort of files are they ? What sort of app is it ? ( compressing/decompressing will involve a performance hit )
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 )
|
|
|
|
|
The DLLs are 3rd party VB .Net tools required by the app. NETZ does a good job in compressing both EXE and DLL files and can even create one overall EXE file with the original EXE and the DLLs included. But...in this particullar case it doesn't work for me. That's why I was asking for any alternatives.
|
|
|
|
|
OK, if you have a tool that does this usually, then I'd suggest it's failing because the dlls are full of jpegs or some other file that's already highly compressed and won't compress further, whatever you do.
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 )
|
|
|
|
|
Don't think you've read my postings correctly. The tool I'm using (NETZ) compresses everything nicely but when the app runs it popping up some errors. I'm just asking for an alternative compressor. The DLLs are not resource DLLs containing pictures or what so ever.
|
|
|
|
|
OK - I see. If there are no resources, how big could these code files actually be ? I mean, most people have 60 gig + hard drives, how big is your project that you want to bother with this ?
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 )
|
|
|
|
|
Does it really matter how big my project is? Like I said I'm just looking for an EXE/DLL compressor as an alternative to NETZ.
|
|
|
|
|
With the limited information you provide it's hard to tell if this is a solution for you - but have you considered simply setting the compressed attribute on the relevant files (maybe letting the installer do it)? Wouldn't work on FAT obviously, so if you need to save space to run from a USB key or something it's probably not an option.
|
|
|
|
|
What is limited? What I want (and I know it can be done by using NETZ) is compress the EXE file and the DLL I have created in a VB. Net and still be able to run this. NETZ only doesn't work on this project that is why I was asing for an alternative - if any.
|
|
|
|
|
The limitation is that you are not trying to tell us what you try to achieve, you tell us what one specific tool does to achieve whatever it is you want. Obviously you want to compress the size of the files for a reason. Tell us WHY you want to do this (download size, size on hard disk, faster load time on slow medias, ...) and we can try to tell you if there are alternative ways of reacing this goal.
Let's try to take your last "requirements document" and break it down towards the solution I gave:
1) You want to compress you VB the EXE and DLL: Setting the compressed attribute on the file system will obviously do this.
2) You want the EXE and DLL to be able to run even though it is compressed: Obviuosly it will still run when the compression is on a file system level.
Hence my suggestion fits what you are telling us. But still it is clearly not good enough for you, so instead of simply repeating the "requirements" our solutions already satisfy, then tell us WHAT it is you want to achieve (as opposed to what you want to do to achieve it).
|
|
|
|