473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Is there a way to test guid string?

Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.
--

SevDer
http://www.sevder.com
A new source for .NET Developers

Jan 26 '06 #1
6 7179
SevDer,

What do you mean exactly? To test what?

--

Stoitcho Goutsev (100)

"SevDer" <se****@newsgroup.nospam> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...
Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.
--

SevDer
http://www.sevder.com
A new source for .NET Developers

Jan 26 '06 #2
SevDer <se****@newsgroup.nospam> wrote:
Is there a way to test guid string?
To test whether a given string is really a GUID? Check that there are
hyphens in all the right places and that the rest of the characters are
in the range 0-9, a-f, A-F. I think that should do it.
I want to do it without try catch block to save on performance.


How many non-GUIDs are you expecting to see? Have you seen what the
*actual* performance impact is? Many people shy away from using
exceptions due to myths about their performance. See
http://www.pobox.com/~skeet/csharp/exceptions.html

Now, if you'd said "because this isn't an exceptional situation, and
I'm validating input data" that would be a much better reason not to
use exceptions.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jan 26 '06 #3
"SevDer" <se****@newsgroup.nospam> wrote in news:eh**************@tk2msftngp13.phx.gbl:
Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.


I concur w/ Jon. In fact, digging around MSDN turned up a regex
pattern you can use to validate a GUID:

[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}

from

http://msdn2.microsoft.com/en-us/lib...US,VS.80).aspx
--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Jan 27 '06 #4
Hi Sev,
Welcome to MSDN Newsgroup!

Based on the current situation, please help me confirm what's the meaning
of "test GUID string"? If you want to test whether or not the GUID string
is valid, I agree with Chris's comment and suggest you could use regular
expression to achieve this goal.

I hope the above information is helpful for you. If you have any questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Reply-To: "SevDer" <se******@sevder.com>
From: "SevDer" <se****@newsgroup.nospam>
Subject: Is there a way to test guid string?
Date: Thu, 26 Jan 2006 17:48:19 -0500
Lines: 15
Organization: http://www.sevder.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Message-ID: <eh**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:381559
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.
--

SevDer
http://www.sevder.com
A new source for .NET Developers


Jan 27 '06 #5
Thanks everybody for your valuable time and comments.
I actually wanted to know if there is a built in method to do that, but
RegEx works for me.

Regards to all

--

SevDer
http://www.sevder.com
A new source for .NET Developers
""TerryFei"" <v-******@online.microsoft.com> wrote in message
news:9k**************@TK2MSFTNGXA02.phx.gbl...
Hi Sev,
Welcome to MSDN Newsgroup!

Based on the current situation, please help me confirm what's the meaning
of "test GUID string"? If you want to test whether or not the GUID string
is valid, I agree with Chris's comment and suggest you could use regular
expression to achieve this goal.

I hope the above information is helpful for you. If you have any
questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Reply-To: "SevDer" <se******@sevder.com>
From: "SevDer" <se****@newsgroup.nospam>
Subject: Is there a way to test guid string?
Date: Thu, 26 Jan 2006 17:48:19 -0500
Lines: 15
Organization: http://www.sevder.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Message-ID: <eh**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.languages.csharp:38155 9
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.
--

SevDer
http://www.sevder.com
A new source for .NET Developers

Jan 27 '06 #6
Hi Sev,
Thanks for your quick response!

Based on my knowledge, there is no a built in method for this. But RegEx
really could works as a workaround for this issue. I am glad to know our
information is helpful for you. Thanks for participating the community.
It's my pleasure to work with you!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Reply-To: "SevDer" <se******@sevder.com>
From: "SevDer" <se****@newsgroup.nospam>
References: <eh**************@tk2msftngp13.phx.gbl> <9k**************@TK2MSFTNGXA02.phx.gbl>Subject: Re: Is there a way to test guid string?
Date: Fri, 27 Jan 2006 10:07:12 -0500
Lines: 74
Organization: http://www.sevder.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Message-ID: <#q**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.languages.csharp:381738
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Thanks everybody for your valuable time and comments.
I actually wanted to know if there is a built in method to do that, but
RegEx works for me.

Regards to all

--

SevDer
http://www.sevder.com
A new source for .NET Developers
""TerryFei"" <v-******@online.microsoft.com> wrote in message
news:9k**************@TK2MSFTNGXA02.phx.gbl...
Hi Sev,
Welcome to MSDN Newsgroup!

Based on the current situation, please help me confirm what's the meaning
of "test GUID string"? If you want to test whether or not the GUID string
is valid, I agree with Chris's comment and suggest you could use regular
expression to achieve this goal.

I hope the above information is helpful for you. If you have any
questions,
please feel free to let me know. Thanks and have a nice day!

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
Reply-To: "SevDer" <se******@sevder.com>
From: "SevDer" <se****@newsgroup.nospam>
Subject: Is there a way to test guid string?
Date: Thu, 26 Jan 2006 17:48:19 -0500
Lines: 15
Organization: http://www.sevder.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.1830
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.1830
Message-ID: <eh**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: mail.dtfares.com 68.167.20.2
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.languages.csharp:3815 59
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Is there a way to test guid string?

I want to do it without try catch block to save on performance.

Thanks in advance.
--

SevDer
http://www.sevder.com
A new source for .NET Developers



Jan 28 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
9
by: Rene | last post by:
I am using the Guid.Empty value ("00000000-0000-0000-0000-000000000000") to represent a special meaning. The problem is that I don't know if there is a chance that a command like...
1
by: Scott M. Lyon | last post by:
I've got a stored procedure that takes a few parameters as input parameters, and one output parameter (a uniqueidentifier). After the stored procedure call, I need to return that output parameter...
1
by: Scott M. Lyon | last post by:
I've got a stored procedure that takes a few parameters as input parameters, and one output parameter (a uniqueidentifier). After the stored procedure call, I need to return that output parameter...
1
by: Wolf | last post by:
Hi I am trying to set a property(PartyHomeAddressID) = to a guid in a ini file. But everytime when the ini file has an empty guid it breaks with an error tellin me a guid is 32 char long with 4...
0
by: PrettySneaky | last post by:
I have at the moment written two webservice prototypes and I am trying do some stress testing with Microsoft application center test. My web page communicates with the the webservice like this: ...
5
by: Michael Primeaux | last post by:
I have a simple .NET 2.0 web service created with VS.NET 2005 with a single web method with the following signature: void HelloWorld(Guid parameter1); When calling this method I receive the...
2
by: Troll | last post by:
Windows XP Pro VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.) I'm using C# to build a custom RSS generator. I'm having trouble building the guid...
4
by: Marc | last post by:
Hi, I don't get it I cannot get this to work, can somebody give me a hint Table1 contains a field Id which is a GUID as primary key and DATA a string, I want to insert a new row but it does not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.