|
You are welcome. Vote if it helped.
|
|
|
|
|
I am wondering what configuration settings(s) are incorrect in a C# 2010 setup and deployment project in the following two situations:
1. My goal is to recover some lost C# .net source code files by looking at the setup and deployment project.
Right now when I use decompiler software, I obtain only the *.cs files that are generated by the .net framework. I do not have any *.cs files that were written by people.
One of my options I have setup in my visual studio.net 2010 professional version is to debug code generated by the .net framework and code written by people. Would I need to change my debug options to 'just my code'?
2. I am wondering if I am looking for the wrong type of files and/or possibly looking in the wrong place for the files?
I am looking at the dll files in the bin directoy fo where the C# 2010 web form application has been deployed to.
Let me know if you have any answer(s) to my question(s).
Thanks!
modified 5-Jul-12 22:11pm.
|
|
|
|
|
You have posted a very similar question in the C# section as well.
It is always advisable not to crosspost.
|
|
|
|
|
sorry. I did not realize that was not a good isea. from now on, i will only post in one forum
|
|
|
|
|
In datalist i have to show the images... Before that i have to set background for every image.. how can i give background image in datalist..?
Example: http://www.csstemplateheaven.com/demo/classic_luxury_demo/gallery.html
In this they have used White backgroud image with some shadows for every image from the database.. Likewise i have to do it in datalist..
I have to set white backfround with some shadows for every images from database...
Please help to solve the above issue..!
aaryanvlb
|
|
|
|
|
I have got the solution using div tag.. Thank You...
|
|
|
|
|
I would like to know what a good open source (free) tool that I can use to compare C#.2010 web form code. Basically I want to compare code that is in a visual studio.net professional environment to the same some that is obtained from Jetbrains dotPeek decompiler tool.
I want to see if the source code I have is the same as the decompiled code.
Does visual studio.net 2010 professional edition have a code compare feature in it? (I am not using team server foundation.) If so, I do I access the code comparison feature in visual studio.net 2010 for web forms?
modified 3-Jul-12 17:19pm.
|
|
|
|
|
I'm just curious, what do you really want to do?
Do you have a DLL in the Bin Folder, and you need to inspect the code, or compare it to replacement code that you are writing to replace the DLL?
If so, do you have the source project to create the DLL?, or your not able to get or obtain the source project code.
|
|
|
|
|
The contract shop that wrote the application gave us a 'copy' of the production code. When we try to make any changes to that code the website has bad error messages. The production executables do not act this way.
Thus we are assuming that the contract shop gave us incorrect 'production' code. If we want to enhance the web application, we know that we can not start with that code base.
The bin directory has alot of dll files. I want to inspect that code and compare it with
the code we are told is the 'good' production code to see what the differences are.
|
|
|
|
|
File dates and version numbers are a good start.
The newer the file, the better the code.
Do you have any of the source projects to the DLL's?
Not that many programmers know how to write a server control compiled as a DLL, because they don't understand the page life-cycle. So what appears to work in development, bombs in actual production use.
In the asp.net website forum server controls, about 3/4 of the OPPs have no clue what there doing. The most common mistakes are classic asp programmers using response.write like it's a php program, to create html tags. The other is not creating html object in OnInit, and loading data in OnLoad.
If you have the source code to the DLL, or at least 1 DLL, post a server control page from it, the whole page, and let me check it out. A server control page should have a header that looks like this, or similar in c#
If the sample looks really bad, then it's a positive indicator that the code needs to be cleaned up, and reformatted, and will represent the quality of all the other code you purchased from the contractor.
Or post 1 page of the decompiled output at least. It will save you a lot of time and trouble, and others will be able to monitor the response, so that's its genuine.
<DefaultProperty("Text"), ToolboxData("<{0}:browser_File runat=server></{0}:browser_File>")> _
Public Class ckEditor_file_Browser
Inherits WebControl
|
|
|
|
|
The bad code I am referring to looks like the contract shop obtained the code from the following url:
<a href="http://www.asp.net/community/control-gallery/Item.aspx?i=69">
The code listed above is embedded in a C# 2010 web form application that uses 2010 master pages alot. There is no MasterPages.dll (assembly) on the server production server.
So could the 'old' master pages code I am referring hurt (interrupt) the regular master pages from working correctly?
|
|
|
|
|
The Project is writen in c#, so if your project is vb, then you have to translate the MasterPages.cs to vb and rename it MasterPages.vb
The MasterPages.cs file needs to be located in a folder called App_Code. This folder is for non dll class objects, and asp.net will compile everything in that folder to a dll in the background. In other words, the Dll's are located in the
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
folder, as shadow copy files.
I use the MasterPage webform, which does the same thing. You make a folder called MasterPages, and place a MasterPage webform type in it. Then you copy and paste your template web markup in it, assign your content region names, and create a regular webform that uses a masterpage, assign the masterpage, and populate your content regions.
The MasterPage has replaced the MasterPages.cs, has a standard item in asp.net, years ago probably back in 2004.
Do a new masterpage as a test, This is a new blank masterpage. The first line is required to tell asp.net that it's a masterpage. I think you can just paste this in, and change your
<%@ Master Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
replace this
<%@ Register TagPrefix="mp" namespace="Microsoft.Web.Samples.MasterPages" assembly="MasterPages" %>
with this
<%@ Master Language="C#" %>
replace this
<mp:region runat="server" id="region1">
with this
<asp:ContentPlaceHolder id="head" runat="server">
|
|
|
|
|
See my answer here[^]. Not exactly what you want but it will allow you to decompile and inspect the dll code and is very easy to use.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
The obvious question that "leaps out at me" on this thread, when you disclose there's some discrepancy between two files that came from a "contract shop:"
Why aren't you able to get the correct code from the contract shop, or get them to resolve this ?
Something happened that prevents you from getting any support from them ?
best, Bill
The glyphs you are reading now: are place-holders signifying the total absence of a signature.
|
|
|
|
|
I did some digging, and it's a an old download from the asp.net website, probably back from 2004 that implements masterpages, before maserpages was included in the framework. The original implementation is a cs file for the App_Code, and he's looking for the DLL file associated for it, for comparison.
I think the app is almost 10 years old, and they don't realize that the app needs a major upgrade.
|
|
|
|
|
hi all
i want to create a website that has ability to create another website like free blogs that every one has a page with own management. so can you tell me how can i do that with asp and vb .
|
|
|
|
|
|
Hi Everyone,
Good evening. Can you help me point out what seems to be the problem with my applciation? I know my problem will be a piece of cake to you guys.
I have a login page where the user will input his username and password:
here is the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Try
status = Request.QueryString("status").ToString()
If status = "NOTADMIN" Then
lblWarning.Text = "Sorry you are not allowed to access the site. Please contact Site Admin."
End If
Catch ex As Exception
Dim a As String = ""
End Try
End If
End Sub
Protected Sub ImageButton1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
If TbUsername.Text <> "" OrElse TbPassword.Text <> "" Then
Session.Timeout = 480
Dim accessData As New DataAccess()
Dim User As String = TbUsername.Text
Dim Username As String() = User.Replace("\", "|").Split("|"c)
Session("Username") = Nothing
Dim Authentication As Boolean = IsUserAuthenticated("LDAP://" & Username(0).ToString(), Username(0).ToString(), Username(1).ToString(), TbPassword.Text.Trim())
If Authentication = True Then
StaticObject.UserName = ""
StaticObject.Password = ""
StaticObject.Domain = ""
StaticObject.Domain = Username(1).ToString()
Session("UserName") = Username(1).ToString()
StaticObject.Domain = Username(0).ToString()
accessData.AddUser(Username(1).ToString())
Dim Authorization As String = accessData.CheckUserAccess(Username(1).ToString())
Dim MyAuthorization As String() = Authorization.Split("|"c)
StaticObject.UserLevel = MyAuthorization(0).ToString()
StaticObject.IsAdmin = MyAuthorization(1).ToString()
If MyAuthorization(0).ToString() <> "9" Then
Session("displayName") = StaticObject.DisplayName
Response.Redirect("Home.aspx")
Else
lblWarning.Text = "Sorry you are not allowed to access this Site, please contact the Site Administrator"
End If
Else
lblWarning.Text = "User Name or Password incorrect! Note: 3 consecutives incorrect login your account will be locked!"
End If
End If
End Sub
Public Function IsUserAuthenticated(ByVal strAdPath As String, ByVal strDomain As String, ByVal strUserName As String, ByVal strPassword As String) As Boolean
Dim directoryEntry As New DirectoryEntry(strAdPath, strUserName, strPassword)
Dim directorySearcher As New DirectorySearcher(directoryEntry)
Dim Authentication As [Boolean]
Try
Dim searchResult As SearchResult = directorySearcher.FindOne()
Authentication = True
directorySearcher.Filter = "(&(objectClass=person) (samaccountname=" & strUserName & "))"
Dim result As SearchResult = directorySearcher.FindOne()
Dim resultEntry As New DirectoryEntry()
resultEntry = result.GetDirectoryEntry()
StaticObject.DisplayName = resultEntry.Properties("displayName").Value.ToString()
Catch ex As Exception
Authentication = False
TbUsername.Text = ""
TbPassword.Text = ""
End Try
Return Authentication
End Function
End Class
so basically it is using windows login.
The poblem is that :
The page does not recognize that there is already a session. Therefore, still showin the login button when it should be logout because the user was able to login.
Here is the code:
Private user As StaticObject = Nothing
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Session("displayName") Is Nothing Then
lblUserFullName.Text = "null"
Else
If Not Page.IsPostBack Then
Try
lblUserFullName.Text = StaticObject.DisplayName
Catch ex As Exception
End Try
End If
End If
End Sub
Protected Sub loginstatus_LoggedOut(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginstatus.LoggedOut
Session.Abandon()
Session.Clear()
End Sub
Protected Sub loginstatus_LoggingOut(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs) Handles loginstatus.LoggingOut
End Sub
thank you very much in advance and I made sure I did my best to fix this before seeking for help.
|
|
|
|
|
It cleared the session when the login button was clicked
Session("Username") = Nothing
And set the value back when the user was authenticated.
It's just using 1 session variable, and seems to update a database table upon login
I would not detect if a user is logged in, and give them access, unless it's security is not a concern
But if you want to, you can just modify the code to detect the session user, and authenticate them again. Strange, I don't see a password, must be the string array userName(1) and userName(0)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Try
If Not Session("user") is nothing then
Dim userName As String = Session("user")
StaticObject.Domain = username.ToString()
Session("UserName") = username.ToString()
StaticObject.Domain = username.ToString()
accessData.AddUser(username.ToString())
Dim Authorization As String = accessData.CheckUserAccess(Username(1).ToString())
Dim MyAuthorization As String() = Authorization.Split("|"c)
StaticObject.UserLevel = MyAuthorization(0).ToString()
StaticObject.IsAdmin = MyAuthorization(1).ToString()
If MyAuthorization(0).ToString() <> "9" Then
Session("displayName") = StaticObject.DisplayName
Response.Redirect("Home.aspx")
else
status = Request.QueryString("status").ToString()
If status = "NOTADMIN" Then
lblWarning.Text = "Sorry you are not allowed to access the site. Please contact Site Admin."
End If
End If
Catch ex As Exception
Dim a As String = ""
End Try
End If
End Sub
|
|
|
|
|
Hi,
Can anybody please advice me if I can apply xml or xsl transformations on xsl-fo. I have an xsl-fo file which I have to transform in to html some how.
Can I apply the xml and xsl transformations that are available in .Net on xml and xsl-fo so that I can apply it and convert it in to html using just .Net libraries that are provided by .Net framework. Not any external third party tools.
Any support like a code snippet or any link would be a great help. i have been googling still not finding it. I will still google but if anybody knows please help me.
Thanks in advance.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
modified 3-Jul-12 14:00pm.
|
|
|
|
|
You may have better luck in the XML / XSL forum.
|
|
|
|
|
Hi,
Actually I am looking for xsl fo transformations, is it possible using .Net without using any 3rd party libraries.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
Hi All,
I have user registration form which is created dynamically depending upon id comming from previous page.
I have to store this id somewhere and want to retrive it in oninit method while postback.
I dont want to use Session or static veriable to store this id, so where should i stored it.
can any one help me out.
thanks in advance.
|
|
|
|
|
Database?
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Just make a global textbox and hide it
CSS Display: none;
You make the textbox in onInit, and load the ID in OnLoad
|
|
|
|