How to give a unique id like that 15b85c2b-83ca-44ec-8741-22a4dc64f64d in using c#
-
I have a little query of generting unique id for creating node , Is there is any way to generate random no ... I have to genarate a random no for FieldUniqueId attribute in the each time when I create a new node .. I tried it by using Session.SessionID but the no string genarated for example 'hzskur45zxzh4jiwq5lsp3j3' this is same during for the logged user .... also i have to generate random no string in the format like '15b85c2b-83ca-44ec-8741-22a4dc64f64d' .. following is the strucuture of XML file Blank Blank NewField1 15b85c2b-83ca-44ec-8741-22a4dc64f64d http://careers.msn.com/ Careers & Jobs <A href="http://careers.msn.com">Careers & Jobs</A> ...... ......
-
I have a little query of generting unique id for creating node , Is there is any way to generate random no ... I have to genarate a random no for FieldUniqueId attribute in the each time when I create a new node .. I tried it by using Session.SessionID but the no string genarated for example 'hzskur45zxzh4jiwq5lsp3j3' this is same during for the logged user .... also i have to generate random no string in the format like '15b85c2b-83ca-44ec-8741-22a4dc64f64d' .. following is the strucuture of XML file Blank Blank NewField1 15b85c2b-83ca-44ec-8741-22a4dc64f64d http://careers.msn.com/ Careers & Jobs <A href="http://careers.msn.com">Careers & Jobs</A> ...... ......
I got the answer..there is a method in System namespace called Guid(). we can use it as string newID = Guid.NewGuid().ToString(); its genarate every time a uniue Id according to my requirement.. Thanks