Yes You can use normal c# and no need of creating Assemblies, dll etc.
thisXDocument.DOM.selectSingleNode(...<You need to write the XML XPAth
here>...).text = System.Environment.UserName;
also go through this link below for better understandin
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=263&SearchTerms=Current,user

Signature
Kalyan Reddy
Visit www.autonomysystems.com
> thanks for you reply but as i can see (i do remind that im new to the
> infopath) only scripting method (like Tools -> script -> On load
> event).... but is it normal c# or VB ?
>
> or do i have to create an full assebly (like dll) in VS.net ?
grisha0@gmail.com - 01 Feb 2006 15:17 GMT
thx big help but i've got an error...
my script.js is:
XDocument.DOM.setProperty("SelectionNamespaces",
'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-02-01T14:45:05"');
function XDocument::OnLoad(eventObj)
{
XDocument.DOM.selectSingleNode("my:mojePola/my:user").text =
System.Environment.UserName;
}
error is:
Error line 7
"System" is undefined
do i miss some directive like c# using ??
Sandeep - 02 Feb 2006 07:28 GMT
Hi grisha
You need to build an ADService webservice and use that to get the User name.
There is another way to get the UserName using an ActiveX component, but
that needs your solution to be a FullTust solution.
There is an ADService available at this site, that you can use to get user
Details from ADService.
Check out this links.
http://www.infopathdev.com/webstore/detail.aspx?itemid=18
http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=1524&SearchTerms=System.Env
ironment.UserName

Signature
Sandeep
www.autonomysystems.com
> thx big help but i've got an error...
>
[quoted text clipped - 15 lines]
>
> do i miss some directive like c# using ??