|
Haha, after a little more searching, I found it here[^]
The syntax is:
public void TraceMessage(string message,
[CallerMemberName] string memberName = "",
[CallerFilePath] string sourceFilePath = "",
[CallerLineNumber] int sourceLineNumber = 0)
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Tip! Tip!
|
|
|
|
|
Good idea.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Interesting.
It is rather new, just available since .NET 4.5
I use Environment.StackTrace (available since 1.0), however that is a very expensive way as it returns the whole stack trace, where one only needs the info about one or two nesting levels.
|
|
|
|
|
Hi This is Chandra,
presently working on GoogleMaps. Right now i can able to bind the langitude and latitude dynamically based on selection of country. That is multiple locations i can able to display in the map.Here my problem is i want to display information window when i click any one of the location. Please find my code below in C~ as well as Asp.net
C# Code:-
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
bindInfo();
}
}
protected void bindInfo()
{
try
{
SqlConnection con = new SqlConnection("Data Source=xxx;Initial Catalog=Test;Persist Security Info=True;User ID=xxx;Password=xxx$;Connect Timeout=38000;pooling='true'; Max Pool Size=200");
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetCountryNames";
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
ddlPostalCode.DataTextField = "Country";
ddlPostalCode.DataValueField = "Country";
ddlPostalCode.DataSource = ds.Tables[0];
ddlPostalCode.DataBind();
con.Close();
}
catch (Exception x)
{
Response.Write(x.ToString());
}
}
private void GetLocation(string CName)
{
try
{
SqlConnection con = new SqlConnection("Data Source=xxxx;Initial Catalog=Test;Persist Security Info=True;User ID=xxxx;Password=xxxx$;Connect Timeout=38000;pooling='true'; Max Pool Size=200");
con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetLocationWiseInfo";
SqlParameter param = new SqlParameter();
param.ParameterName = "@Name";
param.Value = ddlPostalCode.SelectedItem.Text.ToString();
cmd.Parameters.Add(param);
cmd.ExecuteNonQuery();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
BuildScript(ds);
}
catch (Exception x)
{
Response.Write(x.ToString());
}
}
public void BuildScript(DataSet tbl)
{
string Locations = "";
foreach (DataRow dr in tbl.Tables[0].Rows)
{
if (dr["Latitude"].ToString().Trim().Length == 0)
continue;
string Latitude = dr["Latitude"].ToString();
string Longitude = dr["Longitude"].ToString();
string Sales = dr["Sales"].ToString();
Locations += Environment.NewLine + " map.addOverlay(new GMarker(new GLatLng(" + Latitude + "," + Longitude + ")));";
}
js.Text = @"<script type='text/javascript'>
function initialize() {
if (GBrowserIsCompatible())
{
var map = new GMap2(document.getElementById('map_canvas'));
map.setCenter(new GLatLng(45.05,7.6667), 2);
" + Locations + @"
map.setUIToDefault();
}
}
";
}
protected void btnPlaceName_Click(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
GetLocation(ddlPostalCode.SelectedItem.Text.ToString());
}
}
ASPX Code:
<asp:label id="lblName" runat="server" text="Please Select PostalCode">
| <asp:dropdownlist id="ddlPostalCode" runat="server" width="150px"
="">
| <asp:button id="btnPlaceName" runat="server" text="GetGeoData" onclick="btnPlaceName_Click">
|
<asp:panel id="Panel1" runat="server">
<asp:literal id="js" runat="server">
<asp:literal id="js1" runat="server">
In the dataset i am getting rows like Longitude, Latitude and sales data based on selection of Country.
Can any one suggest me how to do that?
Thanks
Chandra
|
|
|
|
|
|
|
Hi All,
Is there a tool kit I haven't installed or is it a case of normal with VS2008 but
MessageBox.Show("Hello ","",MessageBoxButtons.OK,MessageBoxIcon.Hand);
gives gives the cross, Asterisk gives i in a speech bubble, Error gives the cross in red, Exclamation gives a ! in a yellow triangle, Hand gives Error, Information the speech bubble with i,None gives nothing, Question gives a speech bubble with a question mark, Stop gives the white cross with the red background and Warning gives the yellow triangle with a !. This must have been updated, cured and I haven't got it, some ones got to know about it?
Glenn
|
|
|
|
|
They are all there only for backward compatibility to Windows 3.1, where the icon was a Hand, held up to show the palm as a "Stop" sign.
Later version of Windows changed the icon (to make it clearer internationally) but the old names were retained so that earlier code would still compile. The original Windows constant values which display them are all the same value: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx[^]
[edit]Typo - "help" for "held" - OriginalGriff[/edit]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
|
Hello everybody.
I have never woked with networking, and I have a task with it:
On virtual mashine I have a Ubuntu on real mashine I have a Windows, I need to write a programm in Windows which is create a user in Ubuntu. Network connection is setup, mashines are pinging.
I try to use a NFS(Netwerk File System) but I dont know nothing about it... Please help, push me in right side.
How I can do it?
|
|
|
|
|
S.Alexanser wrote: I need to write a programm in Windows which is create a user in Ubuntu
Creating a Windows-program that instructs another application over TCP/IP what to do shouldn't be that hard. I suggest you first focus on that part of the solution.
Second part would be creating the user; what kind of user are we talking about? Do you need to create a local user (?), a database-user (what database?) or a Samba-user (like in a windows-domain?)
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I think, I need to create local user.
|
|
|
|
|
I suggest you verify that by asking your customer, once you finished the first part of the task.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
S.Alexanser wrote: How I can do it?
First step - figure out how to do it MANUALLY. Thus how do you do it typing at the keyboard.
AFTER you do that then you do one of the following.
1. Find an API that matches what you did manually.
2. Just write code that does what you did manually (see the Process class.)
|
|
|
|
|
I need to visualize a number of appointments on a Grid. In my case an appointment is a UserControl that has a number of properties (e.g. StartDate, EndDate, Subject, ...etc). Now I need to render the appointments in such a way that they do not overlap (pretty much like Outlook).
So far I managed to find out which appointments overlap before adding a new one.
The problem is to find an algorithm that determines the correct Width and X position.
Could anyone help me out on this?
Thanks, Dick
modified 6-Jul-12 7:21am.
|
|
|
|
|
You mean something like this[^]?
|
|
|
|
|
I have a C# 2010 application that I have a question about files in the bin directory. I have created a setup and deployment project and installed the application on a test workstation. Can you tell me what format the application1.dll and application2.dll format files are in? Basically if I want to decompile those dlls, would those applications be in an msil format, a C# 2010 .net format or what format would those files be in?
Next step is I want to see the *.cs code from those two dll files. Thus for example if the code is in an MSIL format, what can I do to get the code in a *.cs readable format?
|
|
|
|
|
Easy. All manged code assemblies are compiled down to MSIL. If you want to see a close approximation of the original source code, use .NET Reflector or some equivilent app.
|
|
|
|
|
Thank you for letting me know that code is setup as msil format. However my question is how would I tell a tool like .net reflector, the file is in a Msil format?
Basically I an taking two dll files from the bin directory of where the C# 2010 application is installed as input into the decompiler code. What I am getting is C# code that is generated by the .net framework. I am not getting the C# code that was written by people.
Thus can you tell me how what are the msil files so that I can give these files to the decompiler software? Is the msil file a *.dll file and what directory can I find these files at once the apllication hasd been installed?
|
|
|
|
|
Reflector already knows it is in MSIL - it looks at the content and works that out for itself.
You will never get the exact code written in C# when it is decompiled, unless the DLL is compiled for debugging. The chances are that the DLL you are looking at is compiled for release (as it should be) in which case the optimiser has already moved things around. In addition, it may well be obfuscated - a process which is designed to prevent people like you from getting a good look at the original source code by making it as difficult to read as possible.
Where files are installed is up to the person who wrote the application to a certain extent, so they aren't necessarily installed in a particular location.
Why do I get the feeling you are trying to rip off code from some hard working developer?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
All dlls would be in MSIL format.
Decompilers were just discussed a couple of days ago[^].
|
|
|
|
|
If this is your source, why do you need to disassemble it?
|
|
|
|
|
To create scorm package in c#.Does any one has sample code for that?
|
|
|
|
|
See here[^], please post in one forum only.
|
|
|
|