This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
how to use Profile.GetProfile() in a library class?
How to get profile in a cs class? It works fine in aspx.cs class.
ProfileCommon profile= HttpContext.Current.Profile.GetProfile(username);
How to make GetProfile() available in cs class? please advice, Thank you
Take a look at my answer about profiling users. There is all you need:
User profiles in asp.net
Related
This question already has answers here:
Unity Scripts edited in Visual studio don't provide autocomplete
(35 answers)
Closed 4 years ago.
I've been trying to get the intellisense autocompletion to work with Unity, but after a day of trying to make it work, no solution. Using C#
I'm not asking to solutions on this problem, but to ask where the documentation is found
Solution: #John
https://docs.unity3d.com/ScriptReference/Transform.html
This has all the scripts/functions that intellisense gives you.
Check THIS. You can find everthing there. For example, if you want to implement method from MonoBehavoiur use Ctrl+Shift+M or use Ctrl + Space with all suggestions.
This question already has answers here:
How to get "Host:" header from HttpContext (asp.net)
(4 answers)
Closed 8 years ago.
I want to get datas from an html file on my asp webserver, in Javascript to get actual host we can use the following:
~/mydatas.php
It gives on localhost: "http://localhost/mydatas.php"
I want the same thing but in C# can you help me?
Thanks you.
You could also search in stackoverflow and you will find a lot of answered question which had the same problematic than you. Like this one
Hopes it will help you !
Edit : You can use
HttpContext.Current.Request.Url.AbsoluteUri
It will give you the URL of your web page.
I've already try
HttpContext.Current.Request.Url.Host
which gives on localhost
:\windows\system32\inetsrv\localhost
...
This question already has answers here:
Application.ProductName equivalent in WPF?
(7 answers)
Closed 8 years ago.
Is there something similar to the following property in WPF?
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.productname(v=vs.110).aspx
Thanks.
Not that I know of. But you can easily create this method yourself.
The actual code used by WinForms has several levels of fallback: it first look for an AssemblyProductAttribute on the assembly defining the control, then at the file version and finally falls back to the first part of the namespace.
You can copy that logic (or the parts that are relevant to you) directly from .net source code: http://referencesource.microsoft.com/#System.Windows.Forms/ndp/fx/src/winforms/Managed/System/WinForms/Control.cs#f7c944851a004a6e
This question already has answers here:
C# hide and unhide comments
(6 answers)
Closed 9 years ago.
I am using the C# XML style of documentation in my latest project (eg using ///<summary> stuff). I find this makes the source code a pain to read as it just becomes so long. Is there a way in Visual Studio to auto-collapse just these or do I have to use the collapse to definitions and re-expand functions?
Take a look here at the following post, I think it should help
http://www.helixoft.com/blog/archives/30?n=collapse-all-xml-comments-in-vb-net-or-c
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open file with associated application
I want to open a file in it respective application, e.g. open function of windows.
Same thing can be done in java with the help of Desktop class where you pass the file name and the respective file is opened.
But no idea how to do in C#.
System.Diagnostics.Process.Start("filename.doc");