|
If you have that data in a string, just split it on '\x00' and don't use the last two records in the array, as they will be the strings between the last two terminators and between the last terminator and the end of the string.
---
b { font-weight: normal; }
|
|
|
|
|
Well I ended up doing the following. When I used string as the return value I was only getting the first chuck of data and not the rest.
IntPtr icy = BASS_StreamGetTags( radioChan, BASS_TAG_ICY );
byte[] bytetag = new byte[512];
if (icy != IntPtr.Zero)
{
Marshal.Copy(icy, bytetag, 0, bytetag.Length);
}
ASCIIEncoding encoding = new ASCIIEncoding( );
string constructedString = encoding.GetString(bytetag);
if (constructedString != string.Empty)
{
string tokenizer = "\x00\0";
string[] token = constructedString.Split( tokenizer.ToCharArray(), 13 );
}
Thanks for your help
|
|
|
|
|
Hi all
Is there an easy way to check whether a string contains invalid file name characters or is this a case of "write your own".
Thanks again
MrR_
Nothing is foolproof to the talented fool.
|
|
|
|
|
|
Hi!
The Path class has a static member InvalidPathChars you can use:
bool IsFilenameValid(string filename)
{
return (filename.IndexOfAny(Path.InvalidPathChars) == -1);
}
Regards,
mav
|
|
|
|
|
HELLO
I want to set 1 Month expiry date for my software.
How can I do this.User can set system clock in back date,So how can i check this.
Using Dot Net how can I make installable setup.Should I write registry keys at time of installation.
If yes how?
Regards
|
|
|
|
|
|
Webservice is notpossible in my case.There are products in market that have trial version for 1 month.After one month they got expired like Norton ani virus.Even if we set system clock in back dates..How they do this...
|
|
|
|
|
To prevent back-date being used, implement a scheme like this:
1. At the time of installation, set the date of installation .
2. At the time of every use of software, set some variable for that date as the last date used and store it somewhere for further use. If this variable already contains a date which is later than the date of fresh use of software, do NOT reset it and let it contain that later date.
3. Next, at the time of every use of software, check for today's date . If this date is prior to the last date used stored in step 2 above, then set today's date to the aforesaid last date used . Now check the validity of software from this "revised today's date" from the date of installation and see whether it is less than 30 days or more.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Hi
I have an additional question:
Where should I store the date of installation ?
The user should not be able to delete or change it.
Thanks.
-- modified at 9:17 Wednesday 9th November, 2005
|
|
|
|
|
I have an app that (at the moment) moves through files that are on a web site, and deletes them, wat i want to do for the next stage, is to be able to download each file before i delete it.
i have tried POSTin to be able to view the image, then saving it, but it doesnt work, the problem i have is that all the files on the server have the same name, which is
http://1.1.1.1/DH/repository/content.tif
and for me to be able to view one, i had to send the follow command (that has a fwe ids that tell me the server which file i want)
show=&did=31374&rid=6_2_6_1_2_1&sid=174709756905990&WidthSize=136&useSavedParam=&dummy=
once i did this i got the followin content response
HTTP/1.1 200 OK
Server: Web-Server/3.0 GW-Repository
Content-Length: 24434
Content-Type: image/x-tiff
Set-Cookie: cookieOnOffChecker=on; path=/
Connection: close
MM
i have tried to use the WebClient.DownloadData(http://1.1.1.1/DH/repository/content.tif)
but it simply returns an error.
Does enyone have any ideas.
Thanx in advance
|
|
|
|
|
Create a streamReader from the response stream, create a file and then write the contents of the response to the file.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanx andy, i added this code and it seemed at first to work perfectly
Stream stream = webResponse.GetResponseStream();
Stream imageFile = File.Create(@"C:\IMAGES\image.tif");
Bitmap b = new Bitmap(stream);
b.Save(imageFile, ImageFormat.Tiff);
as i said this works perfectly, but the problem is i have Multi-page Tif images (ie ones that save with more then 1 page), with the above code it seems to only be saving the first page.
any ideas, i thought at first that the server may only return the content of the first page, but when i run it through IE (with fiddler) and view the file i am able to move through all of its pages.
|
|
|
|
|
I'd suspect that the bitmap only supports a single image.
Try something like this:
byte[] buffer = new buffer[1024];
int count;
while ((count = responseStream.Read(buffer, 0, buffer.Length)) > 0)
fileStream.Write(buffer, 0, count);
That should get you the file.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thanx Andy, the code u supplied work perfectly, now it gets all the pags in teh TIF image, and my app has been finished and released.
Thanx again
|
|
|
|
|
Hi,
I am using the listview in the grid format i.e Listview.View.Details.
I have an urgent requrement where in I have to show checkbox and combo boxes in each subitems. In other words there should be few checkbox columns and few combobox columns in the listview.
Currently I am able to show check box for each item in the listview(i.e each row) but I need it for each cells.
Any help/suggestions is highly appreciated
Regards
Hitesh
hiteshsalian@yahoo.co.in
|
|
|
|
|
Serach Code Project. There are very good articles exemplifying exactly that.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
I have written a simple server/client program in C# using System.Net.Sockets, when I attempt to connect to my own computer using the local ipaddress it works fine. When I attempt to connect to other computers using my server program it doesn't work. When I attempt to connect to my own computer using my true ip address it doesn't work. I am connecting using TCP, anybody know why this happens?
|
|
|
|
|
Cofirm your machine has a true IP Address, and You will have it only when you have an adapter.
Try to ascertain using a ping command
CMD > ping <IP Address>
love2code
|
|
|
|
|
Hi everybody. I need to get the .bmp and .ico resources of an excecutable file(.exe) or a .dll file, Using the PE and RVA. Please if anybody can helpme, i will be gratefull.
|
|
|
|
|
And you want to do this in C#? That's a difficult task. I would write the application in C++, and use the resource API functions[^] to get the resources.
There are routines to find all the resources (EnumResourceNames and EnumResourceTypes ) and to modify them (UpdateResource ). Browse MSDN and you'll find a lot of information.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Can anyone please tell me how to convert the Windows Application that was developed in C# to ASP .NET web application
|
|
|
|
|
You'll have to rewrite the entire user interface. And hopefully, if you designed your application well, you'll be able to reuse the business and database logic without many (if any) modifications.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Does DataGrid in windows app. support paging?
If yes then how can I turn it on?
If no then is there a way arround it?
Also I would really like to customize the look of my datagrid like align columns to "center" etc, or may be have certain values BOLD etc, stuff like that.
In ASP.NET we could use DataGrid.ItemBound event or something like that, what can we do in windows app.?
|
|
|
|
|