Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Thursday, March 29, 2012

Newbie - Protecting source code

If I create an ASP.NET (c#) web application, how can I prevent my code being
ripped off when I load it onto a 3rd party web server? (Someone copying the
.cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.
Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
>
Sorted it! Thanks for your help!
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...

> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.
LOL! Absolutely!

Newbie - Protecting source code

If I create an ASP.NET (c#) web application, how can I prevent my code being
ripped off when I load it onto a 3rd party web server? (Someone copying the
..cs files, and removing them)
Is there a way to compile these .cs files for the ASP.NET pages to read.If you're using VS.NET, compile the project,
and only upload the dll's and .aspx files to your
server or, if you're not using VS.NET, compile
the assemblies ( dlls ) from the command line
and deploy them, with your .aspx files, to the server.

Juan T. Llibre
ASP.NET MVP
===========
"Fronky" <nospam@.nospam.com> wrote in message
news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> If I create an ASP.NET (c#) web application, how can I prevent my code
> being
> ripped off when I load it onto a 3rd party web server? (Someone copying
> the
> .cs files, and removing them)
> Is there a way to compile these .cs files for the ASP.NET pages to read.
Sorted it! Thanks for your help!

"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
> If you're using VS.NET, compile the project,
> and only upload the dll's and .aspx files to your
> server or, if you're not using VS.NET, compile
> the assemblies ( dlls ) from the command line
> and deploy them, with your .aspx files, to the server.
>
>
> Juan T. Llibre
> ASP.NET MVP
> ===========
> "Fronky" <nospam@.nospam.com> wrote in message
> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
> > If I create an ASP.NET (c#) web application, how can I prevent my code
> > being
> > ripped off when I load it onto a 3rd party web server? (Someone copying
> > the
> > .cs files, and removing them)
> > Is there a way to compile these .cs files for the ASP.NET pages to read.
Of course, if the security on the server is such that someone could view the
source code of your ASP.Net pages, you have a more serious problem.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Fronky" <nospam@.nospam.com> wrote in message
news:u5HmNDUCFHA.520@.TK2MSFTNGP09.phx.gbl...
> Sorted it! Thanks for your help!
>
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uxQbcyTCFHA.1396@.TK2MSFTNGP14.phx.gbl...
>> If you're using VS.NET, compile the project,
>> and only upload the dll's and .aspx files to your
>> server or, if you're not using VS.NET, compile
>> the assemblies ( dlls ) from the command line
>> and deploy them, with your .aspx files, to the server.
>>
>>
>>
>>
>> Juan T. Llibre
>> ASP.NET MVP
>> ===========
>> "Fronky" <nospam@.nospam.com> wrote in message
>> news:OJmXokTCFHA.2032@.tk2msftngp13.phx.gbl...
>> > If I create an ASP.NET (c#) web application, how can I prevent my code
>> > being
>> > ripped off when I load it onto a 3rd party web server? (Someone copying
>> > the
>> > .cs files, and removing them)
>> > Is there a way to compile these .cs files for the ASP.NET pages to
>> > read.
>>>>
>>
"Kevin Spencer" <kevin@.DIESPAMMERSDIEtakempis.com> wrote in message
news:O$DN%23pVCFHA.3976@.tk2msftngp13.phx.gbl...

> Of course, if the security on the server is such that someone could view
> the source code of your ASP.Net pages, you have a more serious problem.

LOL! Absolutely!

Monday, March 26, 2012

Newbie ? about Classes

I'm not entirely clear on when to create a class and when to just code subs and funcs. I'm getting pretty comfortable with the latter and am beging to wonder if I should be learning to write classes. Any thoughts would be apreaciated.
Thanks
Raif
This depends entirely on a combination of your goals and your preferences.

Classes are an excellent way to get some reusability out of your code that might apply to more than one web page, or even multiple applications. They can increase development time initially, but you may recover this time on future projects from reuse.

Using classes can also make your code more readable, and therefor more maintainable.

The biggest advantage to writing classes is that it gets you going with Object Oriented Programming. OOP is extremely important in .NET because as you create classes and such, you will begin to build a giant library that you and your team can re-use for future projects. If you do not practice OOP in .NET, you will be spending way to much time in writing the same code over and over again for different projects. For instance, creating Table controls, TableRow controls, TableCell controls can be tedious at times. This would call for a WebControlHelper class that you can reuse for all of your projects. Not only that, as you come up with better techniques for clean up and speed, you can make changes to that class and as long as the method signature and its return type doesn't change, all applications you used this helper for would benefit from it.

i.e.


public class WebControlHelper
{
public WebControlHelper
{

}

public Table CreateTable ()
{
return new Table();
}

public Table CreateTable (int numRows)
{
Table thisTable = null ;

try
{
thisTable = CreateTable();
for (int i=0;i<numRows;i++)
thisTable.Rows.Add(new TableRow());
}
catch (Exception e)
{ throw new Exception (e.ToString(), e); }
finally
{
thisTable.Dispose();
thisTable = null ;
}
}
}

This can go on and on to create quite a large helper class and it will save you time later. Let me know if I can be of further help. I'll be glad too!
AND - if you have subs or functions that you use over and over, you'd want to centralize them in a .vb or .cs file (depending on the language you're using)
That way, they're accessible to any aspx document in your application.
how do i include the cs/vb file containing my reusable functions and procedures?

i read that you can compile it to a dll and have it as part of your Imports. is there a way to do it without compiling?

thanks.

Newbie Alert: Please help with repeater control and list box

Hi Guru's,

I am new to asp.net!

I can create a repeater control but would like to add a select list to
it as follows:

<%@dotnet.itags.org. Page Language="vb" debug=true %>
<%@dotnet.itags.org. import Namespace="System.Data" %>
<%@dotnet.itags.org. import Namespace="System.Data.SqlClient" %>
<script runat="server"
Sub Page_Load(sender As Object, e As EventArgs)
Dim myConnection As SqlConnection
Dim myCommand As SqlDataAdapter
myConnection = New SqlConnection("server=local;user
id=whocares;database=dbSeekersClientApp;Trusted_Co nnection=false")
myCommand = New SqlDataAdapter("SELECT ID, username, password,
firstname, surname, account_live FROM t_managers", myConnection)
Dim ds As Dataset = new DataSet()
myCommand.Fill(ds)

MyRepeater.DataSource = ds
MyRepeater.DataBind()

End SUb

</script>
<html>
<head>
</head>
<body
<form action="intro1.aspx" method="post" runat="server"
<ASP:Repeater id="MyRepeater" runat="server">
<HeaderTemplate>
<table width="100%" style="font: 8pt verdana">
<tr style="background-color:DFA894">
<th>
User ID
</th>
<th>
Surname
</th>
<th>
Firstname
</th>
<th>
Username
</th>
<th>
Password
</th>
<th>
Access
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr style="background-color:FFECD8">
<td>
<%# DataBinder.Eval(Container.DataItem, "ID") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem, "surname")
%>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"firstname") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"username") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"password") %>
</td>
<td>
>>>>> Problem code

<asp:DropDownList id="dList1" width=100 runat="server">
<option
value=<%#DataBinder.Eval(Container.DataItem, "account_live")%>>
<%# DataBinder.Eval(Container.DataItem, "account_live") %>
</option>
>>>> Problem code ends

</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</ASP:Repeater>
</form>
</body>
</html
Any pointers?Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"John sorCrer" <info@.emap.co.za> wrote in message
news:d70138e4.0403021226.36b59c74@.posting.google.c om...
> Hi Guru's,
> I am new to asp.net!
> I can create a repeater control but would like to add a select list to
> it as follows:
> <%@. Page Language="vb" debug=true %>
> <%@. import Namespace="System.Data" %>
> <%@. import Namespace="System.Data.SqlClient" %>
> <script runat="server">
> Sub Page_Load(sender As Object, e As EventArgs)
> Dim myConnection As SqlConnection
> Dim myCommand As SqlDataAdapter
> myConnection = New SqlConnection("server=local;user
> id=whocares;database=dbSeekersClientApp;Trusted_Co nnection=false")
> myCommand = New SqlDataAdapter("SELECT ID, username, password,
> firstname, surname, account_live FROM t_managers", myConnection)
> Dim ds As Dataset = new DataSet()
> myCommand.Fill(ds)
> MyRepeater.DataSource = ds
> MyRepeater.DataBind()
> End SUb
> </script>
> <html>
> <head>
> </head>
> <body>
> <form action="intro1.aspx" method="post" runat="server">
> <ASP:Repeater id="MyRepeater" runat="server">
> <HeaderTemplate>
> <table width="100%" style="font: 8pt verdana">
> <tr style="background-color:DFA894">
> <th>
> User ID
> </th>
> <th>
> Surname
> </th>
> <th>
> Firstname
> </th>
> <th>
> Username
> </th>
> <th>
> Password
> </th>
> <th>
> Access
> </th>
> </tr>
> </HeaderTemplate>
> <ItemTemplate>
> <tr style="background-color:FFECD8">
> <td>
> <%# DataBinder.Eval(Container.DataItem, "ID") %>
> </td>
> <td>
> <%# DataBinder.Eval(Container.DataItem, "surname")
> %>
> </td>
> <td>
> <%# DataBinder.Eval(Container.DataItem,
> "firstname") %>
> </td>
> <td>
> <%# DataBinder.Eval(Container.DataItem,
> "username") %>
> </td>
> <td>
> <%# DataBinder.Eval(Container.DataItem,
> "password") %>
> </td>
> <td>
> >>>>> Problem code
> <asp:DropDownList id="dList1" width=100 runat="server">
> <option
> value=<%#DataBinder.Eval(Container.DataItem, "account_live")%>>
> <%# DataBinder.Eval(Container.DataItem, "account_live") %>
> </option>
> >>>> Problem code ends
> </asp:DropDownList>
> </td>
> </tr>
> </ItemTemplate>
> <FooterTemplate>
> </table>
> </FooterTemplate>
> </ASP:Repeater>
> </form>
> </body>
> </html>
>
> Any pointers?

Newbie ASP.NET Testing probles

OK I'm a complete beginner, and I've hit a snag.
I'm using Dreamweaver to create my ASP.NET pages, and i'm testing on my pc.
I have
XP Pro (Service Pack 2)
.NET Framework 1.1
IIS
and I'm using VB as my language
The problem is when i create my pages (that are stored in the wwwroot folder in inetpub) they do not run the ASP.NET VB code. I do not get errors it just shows some of the text but not the bits that should be generated by the VB and when I view the source code it says exactly what i have typed in my page. Not the HTML page that should be created with ASP.NET VB?, hiding the code you have written.
An example of this is this page.
<%@dotnet.itags.org.Page Language="VB" Debug="True" Explicit="True" %>
<html>
<head>
<title>Date</title>
</head>
<body>
<%
Dim CurrentDate As String
CurrentDate = Today
%>
The Current Date is <%=CurrentDate %>.<br>
</body>
</html>
Which produces the following result
The Current Date is .
My preview page in Dreamweaver says.
The Current Date is {text}.
Has anyone got any ideas please. Do I need to tweak the settings of IIS or do I need to install something into my inetpub?
Any help would be great guys thanks.

I don't use the inline method, which you're trying to use here...but itappears you're missing <script> tags. You should have alook at the tutorials on this site.
http://asp.net/Tutorials/quickstart.aspx

To get into the ASP.NET swing of things, try your page like this:
<%@. Page Language="VB" %>
<script runat="server">
Sub Page_Load (s As Object, e As EventArgs)
lblDate.text = DateTime.Now.ToString("d")
End Sub
</script>
<html>
<head>
<title>Date</title>
</head>
<body>
<form runat="server">
The Current Date is <asp:Label id="lblDate" runat="server"/>
</form>
</body>
</html>

As Frank said, definitely work through the tutorials, and strongly consider picking up a copy ofASP.NET Unleashed, Second Edition. Make that, DEFINITELY pick up a copy of that book! Every new ASP.NET developer should have it.

Cheers Tmorton
I've bought ASP.NET unleashed, Second Edition. Excellent recommendation.
I've got the code to work now. I've stopped using dreamweaver for testing. I create my site and ASPX pages in dreamweaver then open the file in web matrix to insert my code and test the pages.
To follow on from your previous post.
Having used ASP.NET unleashed and looked at the tutorials on the site; I can't find samples of what I am trying to do. After covering adding the date and calendar sections as ways of adding real time data into pages, which technique would be best to add these to multiple pages with the view to making altering the modification properties easiest to change i.e. font type and color without having to change every page on the site?
Should I use Global.asax or the config file in the bin? Or is there another way.
Sorry for the long winded description but I am new to this so I need to explain what I am trying to do.
Any links or tutorial references will be great
Cheers
RDG01


RDG01 wrote:

I've bought ASP.NET unleashed, Second Edition. Excellent recommendation.



Yes, that book is highly recommended across the board. I am glad you are finding it helpful.


RDG01 wrote:


After covering addingthe date and calendar sections as ways of adding real time data intopages, which technique would be best to add these to multiple pageswith the view to making altering the modification properties easiest tochange i.e. font type and color without having to change every page onthe site?


This sounds like a job for a user control. Check out chapter 5 ofthe ASP.NET Unleashed book you have in your hands - Creating CustomControls with User Controls.


newbie configuration question

Hello.

I want to use asp not only with my admin account but also with a normal user account.
But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
bringing the message "The page cannot be displayed".

Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found a
really good web site concerning asp.

Thanks a lot for every little help!
Greetings,
timtos.Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory, choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain and NAMEOFYOURPC the name of your web server.



HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
>
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
>
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found a
> really good web site concerning asp.
>
> Thanks a lot for every little help!
> Greetings,
> timtos.
>
I also have found this (http://msdn.microsoft.com/library/d...sp_tut_00.asp):

Web permissions are set in IIS with the IIS Manager. However, those permissions can be undermined by NTFS permissions on specific files and folders. You may allow a user access to your Web site in IIS, but if NTFS file permissions deny access to an ASP file or a database file, your Web user does not see the file. If you are using Anonymous authentication, you must set NTFS permissions to allow access to the IWAM_ComputerName and IUSR_ComputerName accounts. Please see "Access Control" in Windows Help, the "Security" section in IIS Help, which is accessible from IIS Manager, and the IIS TechNet articles about NTFS Security.
Greetings

Daniel

"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@.freudenberg.de> schrieb im Newsbeitrag news:u2J2C5mlDHA.1084@.tk2msftngp13.phx.gbl...
Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory, choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain and NAMEOFYOURPC the name of your web server.



HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
>
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
>
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found a
> really good web site concerning asp.
>
> Thanks a lot for every little help!
> Greetings,
> timtos.
>
Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory, choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain and NAMEOFYOURPC the name of your web server.



HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
>
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
>
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found a
> really good web site concerning asp.
>
> Thanks a lot for every little help!
> Greetings,
> timtos.
>
Thanks a lot for the detailed answers!
I will go through this informatin right now.

So thanks again and greetings,
timtos.
-- Original Message --
From: Daniel Walzenbach
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Sunday, October 19, 2003 8:37 PM
Subject: Re: newbie configuration question

I also have found this (http://msdn.microsoft.com/library/d...sp_tut_00.asp):

Web permissions are set in IIS with the IIS Manager. However, those permissions can be undermined by NTFS permissions on specific
files and folders. You may allow a user access to your Web site in IIS, but if NTFS file permissions deny access to an ASP file or a
database file, your Web user does not see the file. If you are using Anonymous authentication, you must set NTFS permissions to
allow access to the IWAM_ComputerName and IUSR_ComputerName accounts. Please see "Access Control" in Windows Help, the "Security"
section in IIS Help, which is accessible from IIS Manager, and the IIS TechNet articles about NTFS Security.
Greetings
Daniel
"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@.freudenberg.de> schrieb im Newsbeitrag news:u2J2C5mlDHA.1084@.tk2msftngp13.phx.gbl...
Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory,
choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain
and NAMEOFYOURPC the name of your web server.

HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found
a
> really good web site concerning asp.
> Thanks a lot for every little help!
> Greetings,
> timtos.
I also have found this (http://msdn.microsoft.com/library/d...sp_tut_00.asp):

Web permissions are set in IIS with the IIS Manager. However, those permissions can be undermined by NTFS permissions on specific files and folders. You may allow a user access to your Web site in IIS, but if NTFS file permissions deny access to an ASP file or a database file, your Web user does not see the file. If you are using Anonymous authentication, you must set NTFS permissions to allow access to the IWAM_ComputerName and IUSR_ComputerName accounts. Please see "Access Control" in Windows Help, the "Security" section in IIS Help, which is accessible from IIS Manager, and the IIS TechNet articles about NTFS Security.
Greetings

Daniel

"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@.freudenberg.de> schrieb im Newsbeitrag news:u2J2C5mlDHA.1084@.tk2msftngp13.phx.gbl...
Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory, choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain and NAMEOFYOURPC the name of your web server.



HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
>
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
>
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found a
> really good web site concerning asp.
>
> Thanks a lot for every little help!
> Greetings,
> timtos.
>
Thanks a lot for the detailed answers!
I will go through this informatin right now.

So thanks again and greetings,
timtos.
-- Original Message --
From: Daniel Walzenbach
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Sunday, October 19, 2003 8:37 PM
Subject: Re: newbie configuration question

I also have found this (http://msdn.microsoft.com/library/d...sp_tut_00.asp):

Web permissions are set in IIS with the IIS Manager. However, those permissions can be undermined by NTFS permissions on specific
files and folders. You may allow a user access to your Web site in IIS, but if NTFS file permissions deny access to an ASP file or a
database file, your Web user does not see the file. If you are using Anonymous authentication, you must set NTFS permissions to
allow access to the IWAM_ComputerName and IUSR_ComputerName accounts. Please see "Access Control" in Windows Help, the "Security"
section in IIS Help, which is accessible from IIS Manager, and the IIS TechNet articles about NTFS Security.
Greetings
Daniel
"Daniel Walzenbach" <daniel.walzenbach.NOSPAM@.freudenberg.de> schrieb im Newsbeitrag news:u2J2C5mlDHA.1084@.tk2msftngp13.phx.gbl...
Timtos,

AFAIK you have to configure the NFTS permissions on your web server for your specific directory. Try to right click your directory,
choose properties > security and add rights for the user YOURDOMAIN\IUSR_NAMEOFYOURPC where YOURDOMAIN is the name of your domain
and NAMEOFYOURPC the name of your web server.

HTHs

Best regards

Daniel Walzenbach

P.S. If you need to contact me simply remove ".NOSPAM" from my email address.

"timtos" <tirobu@.gmx.de> schrieb im Newsbeitrag news:bmu2ad$ian$1@.news.uni-koblenz.de...
> Hello.
> I want to use asp not only with my admin account but also with a normal user account.
> But being logged in as a normal user I cant create files or directories in the inetpub\wwwroot\ directory and http://localhost is
> bringing the message "The page cannot be displayed".
> Where can I configure iis or a user account that way that a normal user can use asp/ localhost. I know that this is a very basic
> question but in my asp-book nothing is mentioned about it. So also a recommended reading would be nice. Until now I havent found
a
> really good web site concerning asp.
> Thanks a lot for every little help!
> Greetings,
> timtos.

Saturday, March 24, 2012

Newbie help Webpage that pings servers and returns if it is up.

I want to create a web page that will ping a server an return a if the machine is up.
If it is up i want it to change an image to another image to tell me the server is down.
Can anyone help?You could use something like:
try {

WebRequest test = WebRequest.Create("http://www.domain.com");

//display "up" image

} catch ( Exception e ) {

//display "down" image
}

For more information on System.Net.WebRequest use the link below (.NET Class Library) and in the left frame go to System.Net -> WebRequest.
Hey thanx for the replay but im new to this stuff is there anyway you could give me a little more info?

Newbie help with RadioButtonList

Hi, I have only been at this for a few days, so please bear with me as I have no previous programming experience at all.

I am trying to create a simple Exchange Rate converter for our company.

Please find attached code


Function getrate() As System.Data.IDataReader
Dim connectionString As String = "server='(local)\netsdk'; trusted_connection=true; database='Exchange_Rate_Convert"& _
"er'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)

Dim queryString As String = "SELECT [Rates].* FROM [Rates]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection

dbConnection.Open
Dim dataReader As System.Data.IDataReader = dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)

Return dataReader
End Function

Sub Page_Load(sender As Object, e As EventArgs)
if not page.ispostback then
rates.datasource = getrate()
rates.databind()

rates1.datasource = getrate()
rates1.databind()
end if
End Sub

Sub rates_SelectedIndexChanged(sender As Object, e As EventArgs)

currencytxt.text = " " & rates.selecteditem.text

End Sub

Sub rates1_SelectedIndexChanged(sender As Object, e As EventArgs)

finaltxt.text = ((value_to_convert.text / rates.selecteditem.value) * rates1.selecteditem.value)
End Sub

I have 3 questions:

Question 1:

Everything works as I expected it to if the user uses it once, Enter value -> click on first currency -> click on second currency.

However if they (Perhaps) realized they made a mistake with the first currency click again, then the "Finaltxt.txt value" is not correct.

What I would like to do is to allow as many different button clicks from both sets of Radiobuttonlist's as they care to use and have "Finaltxt.txt value" updated every time a new button is pressed. - I also imagine they may keep the browser open all day and use it perodicaly.

Question 2:

I am not really sure that I should be doing "Maths" from data held in a text box. (I would have assumed this data to be a string, however it does work, I would have thought I would need to convert it in some way but I can't find an appropriate command/syntax.

Question 3:

How do I format the value shown in "Finaltxt.txt value", I would like this figure to be rounded up to two decimal places.

I would appreciate any help given.

Best wishes.

James.perhaps u should have a command button to do the actual conversion

Thursday, March 22, 2012

Newbie issue: Error creating Web Service in VS 2003

This summary is not available. Please click here to view the post.

Newbie issue: Error creating Web Service in VS 2003

Hi all! Here's my problem:

When trying to create a new C# Web Service in VS 2003, I get the following error
message:
"The Web server reported the following error when attempting to create or open
the Web project located at the following URL: 'http://localhost/WebService1'.
'HTTP/1.1 500 Internal Server Error'.

The Event Viewer contains 2 copies of this entry:
"Failed to execute request because the App-Domain could not be created. Error:
0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).

IIS Log file contains the following:
#Software: Microsoft Internet Information Services 5.1
#Version: 1.0
#Date: 2004-07-20 13:44:50
#Fields: time c-ip cs-method cs-uri-stem sc-status
13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500

I have:
Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub folder.
Modified the <processModel> section of the Machine.Config file so that the the
SYSTEM account is being used.
Run aspnet_regiis.exe.
Probably done some other things I can no longer remember.

The machine is my normal local development box - running XP Pro.
I can hit http://localhost and all is well.
This is the first time I've tried to create a Web Service on this machine, so I
can't tell you if something has changed or if it ever worked.

I'm assuming it's a rights issue of some sort (although that get_aspx_ver.aspx
returning a '500' has me a bit confused - but like I mentioned, I'm a newbie).

Any suggestions would be much appreciated.

Thanks!

-- JimDid u google it ??
u'll find some posts on it ... are u developing on a domain controller
itself ?

--
Regards,
Mike
http://bikesh.europe.webmatrixhosting.net
http://www.planetsourcecode.com (search keyword: phoetus)

"JPH" <JPH_member@.newsguy.com> wrote in message
news:cdj8ad02cop@.drn.newsguy.com...
> Hi all! Here's my problem:
> When trying to create a new C# Web Service in VS 2003, I get the following
error
> message:
> "The Web server reported the following error when attempting to create or
open
> the Web project located at the following URL:
'http://localhost/WebService1'.
> 'HTTP/1.1 500 Internal Server Error'.
>
> The Event Viewer contains 2 copies of this entry:
> "Failed to execute request because the App-Domain could not be created.
Error:
> 0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).
>
> IIS Log file contains the following:
> #Software: Microsoft Internet Information Services 5.1
> #Version: 1.0
> #Date: 2004-07-20 13:44:50
> #Fields: time c-ip cs-method cs-uri-stem sc-status
> 13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
> 13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500
> I have:
> Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
> Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
> Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub
folder.
> Modified the <processModel> section of the Machine.Config file so that the
the
> SYSTEM account is being used.
> Run aspnet_regiis.exe.
> Probably done some other things I can no longer remember.
>
> The machine is my normal local development box - running XP Pro.
> I can hit http://localhost and all is well.
> This is the first time I've tried to create a Web Service on this machine,
so I
> can't tell you if something has changed or if it ever worked.
> I'm assuming it's a rights issue of some sort (although that
get_aspx_ver.aspx
> returning a '500' has me a bit confused - but like I mentioned, I'm a
newbie).
> Any suggestions would be much appreciated.
> Thanks!
> -- Jim

--
Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.723 / Virus Database: 479 - Release Date: 20/07/2004
Oh yeah, I definitely googled it. Tried everything I found - no luck
whatsoever.

And nope - not on a domain controller, though I did try q315158 just in case -
no luck there either.

In article <ulGYmOnbEHA.1644@.tk2msftngp13.phx.gbl>, Mike Smith says...
>Did u google it ??
>u'll find some posts on it ... are u developing on a domain controller
>itself ?
>--
>Regards,
>Mike
>http://bikesh.europe.webmatrixhosting.net
>http://www.planetsourcecode.com (search keyword: phoetus)
>"JPH" <JPH_member@.newsguy.com> wrote in message
>news:cdj8ad02cop@.drn.newsguy.com...
>> Hi all! Here's my problem:
>>
>> When trying to create a new C# Web Service in VS 2003, I get the following
>error
>> message:
>> "The Web server reported the following error when attempting to create or
>open
>> the Web project located at the following URL:
>'http://localhost/WebService1'.
>> 'HTTP/1.1 500 Internal Server Error'.
>>
>>
>> The Event Viewer contains 2 copies of this entry:
>> "Failed to execute request because the App-Domain could not be created.
>Error:
>> 0x80131534" (Source: ASP.NET 1.1.4322.0, Event ID: 1088).
>>
>>
>> IIS Log file contains the following:
>> #Software: Microsoft Internet Information Services 5.1
>> #Version: 1.0
>> #Date: 2004-07-20 13:44:50
>> #Fields: time c-ip cs-method cs-uri-stem sc-status
>> 13:44:50 127.0.0.1 GET /WebService1/get_aspx_ver.aspx 500
>> 13:44:50 127.0.0.1 GET /get_aspx_ver.aspx 500
>>
>> I have:
>> Uninstalled VS 2003, the .NET v1.1 Framework, and IIS.
>> Re-installed IIS, the .NET v1.1 Framework, and VS 2003.
>> Given the ASPNET user "Admin" rights and I/O rights to the C:\Inetpub
>folder.
>> Modified the <processModel> section of the Machine.Config file so that the
>the
>> SYSTEM account is being used.
>> Run aspnet_regiis.exe.
>> Probably done some other things I can no longer remember.
>>
>>
>> The machine is my normal local development box - running XP Pro.
>> I can hit http://localhost and all is well.
>> This is the first time I've tried to create a Web Service on this machine,
>so I
>> can't tell you if something has changed or if it ever worked.
>>
>> I'm assuming it's a rights issue of some sort (although that
>get_aspx_ver.aspx
>> returning a '500' has me a bit confused - but like I mentioned, I'm a
>newbie).
>>
>> Any suggestions would be much appreciated.
>>
>> Thanks!
>>
>> -- Jim
>>
>
>--
>Outgoing mail is certified Virus Free. (well i'd like to think it is.. )
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.723 / Virus Database: 479 - Release Date: 20/07/2004

newbie learns ASP.NET

I try to create a new web application by Microsoft Visual Studio. But it
made me wait long time with Create New Web window
Please tell me what wrong.

System configuration:
Platform: Microsoft Windows XP Pro sp2
web server: IIS 5.0
I also create a virtual directory

Please tell me what wrong
ThanksHi,

1. Does this happen every time you create a new web app?
2. which version of Visual Studio and Asp.Net are you using?
3. Do you get any error during this?

++Vijay R

"Dean L. Howen" wrote:

> I try to create a new web application by Microsoft Visual Studio. But it
> made me wait long time with Create New Web window
> Please tell me what wrong.
> System configuration:
> Platform: Microsoft Windows XP Pro sp2
> web server: IIS 5.0
> I also create a virtual directory
> Please tell me what wrong
> Thanks
>
>I try to create a new web application by Microsoft Visual Studio. But it
>made me wait long time with Create New Web window
> Please tell me what wrong.

I have no idea what is wrong. You're supposed to tell us, and then we tell
you how to fix it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.

"Dean L. Howen" <coldman@.hotpop.com> wrote in message
news:ubN4OColFHA.1968@.TK2MSFTNGP14.phx.gbl...
>I try to create a new web application by Microsoft Visual Studio. But it
>made me wait long time with Create New Web window
> Please tell me what wrong.
> System configuration:
> Platform: Microsoft Windows XP Pro sp2
> web server: IIS 5.0
> I also create a virtual directory
> Please tell me what wrong
> Thanks

newbie learns ASP.NET

I try to create a new web application by Microsoft Visual Studio. But it
made me wait long time with Create New Web window
Please tell me what wrong.
System configuration:
Platform: Microsoft Windows XP Pro sp2
web server: IIS 5.0
I also create a virtual directory
Please tell me what wrong
ThanksHi,
1. Does this happen every time you create a new web app?
2. which version of Visual Studio and Asp.Net are you using?
3. Do you get any error during this?
++Vijay R
"Dean L. Howen" wrote:

> I try to create a new web application by Microsoft Visual Studio. But it
> made me wait long time with Create New Web window
> Please tell me what wrong.
> System configuration:
> Platform: Microsoft Windows XP Pro sp2
> web server: IIS 5.0
> I also create a virtual directory
> Please tell me what wrong
> Thanks
>
>
>I try to create a new web application by Microsoft Visual Studio. But it
>made me wait long time with Create New Web window
> Please tell me what wrong.
I have no idea what is wrong. You're supposed to tell us, and then we tell
you how to fix it.
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Everybody picks their nose,
But some people are better at hiding it.
"Dean L. Howen" <coldman@.hotpop.com> wrote in message
news:ubN4OColFHA.1968@.TK2MSFTNGP14.phx.gbl...
>I try to create a new web application by Microsoft Visual Studio. But it
>made me wait long time with Create New Web window
> Please tell me what wrong.
> System configuration:
> Platform: Microsoft Windows XP Pro sp2
> web server: IIS 5.0
> I also create a virtual directory
> Please tell me what wrong
> Thanks
>

Newbie Microsoft VS.net Code Behind Problem

Hi!!
I am using ASP.net with Code Behind for the first time on Visual Studio. I had some problems and questions.
When we create a Web App Project in VS do i need to copy the resx file too?
Actually i made a page. It is now a .aspx file, a .aspx.vb and a .aspx.resx file. I also made a new class in a VB file. when i built the project i found the dll in the bin folder.
I uploaded the stuff onto the web page (all three, global.asax, web.config) and the dll into the bin folder of my websites root, but it doesnt work. I made some changes in my project and rebuilt it, but the changes werent reflected (i added a Response.Write in the Page_Load).
I copied the vb file to the sites root too but the thing doesnt work. Its working perfectly on my localhost.
I also wanted to know that i added the class in the file by choosing Add Class in the projects menu. So its automatically compiled to a dll right? Another thing is that in localhost the site was working in a folder and not directly in wwwroot (in a folder called even). So when i was to import my custom made namespace it was referenced as Even.MyNameSpace, but normally i compile it to a dll and do it directly.
Another thing is that i tried compiling it to a dll. Visual Studio tools and then VS.net Command prompt, followed by vbc /t:library myVbFile.vb but it couldnt compile. It couldnt find the namespace i imported. It cant even import namespaces like System.Xml etc.
Someone please help. Please tell me if i am not clear as this is a very basic problem.Lots of problems and possible issues here. To start with, you'd have to explain what "didn't work" means. Have you tested a very simple Hello World! ASPX file, with no code behind, to make sure you understand the basics of working with VS and your web host?
Jeff
Well I uploaded a file which on clicking over a button shows the contents of an XML file.
I made a namespace and added a class in it to access and XML file. In my pages code behind i use this class to return the data. (the xml contains values coupled together). The class has many function like getData1, getData2 etc.
The Class for reading the XML throws a user created exception (that i made) if no data existed, else it threw the usual exception. This is caught by the page in which i have called the xml reader class. If its the user exception it simply writes that no data was found else it writes the exceptions text. So initially as i said when i uploaded it gave a message written "The remote server returned an error: (404) Not Found." as the exception's message. I then uploaded all the files i mentioned alongwith the assemblyinfo. But it still didnt work. Then i uploaded a new file which had a "page loaded" string in its page_load, but the changes were not affected. I rebuilt the project in VS and then uploaded the new resx, aspx.vb and aspx files, but to no avail.
I have worked on Dreamweaver and without code behind. Later i tried to compile the VB file but the VS .net command prompt compiler gave me that error. My VS by default creates page with code behind only. Can this be changed? Actually i want to create my own class and compile it to a dll and then make the page inherit from the class from the dll.
I have another question. I had named my project even in VS and then started working in the folder even in the wwwroot. Now i uploaded the whole folder onto the site in a folder placed in the root with the same name as even. Made it an IIS application but still the code doesnt run. It started workng after i uploaded the aspnet_client to the even folder.
Can anyone tell me how i can deploy this to my root? Moreover when i change any file what all files do i need to upload again? Is there a way to prevent VS to automatically creating a page behind as i would like to put all my classes into a dll and then use them as page behind. Moreover when i build the project are the .vb files automatically compiled to dll?
I have one basic question. How do we deploy our VS projects to our web site? I am not able to get any file to work on the website. I have no problems at my own computer and everything is working fine. I am sure a lot of people here can teach me how to deploy VS projects? What all changes etc have to be done?
Im no expert here but if you compile this as a release instead of a Debug build and then create a "Web Setup Project" under the New Projects and then choose Setup and Deployment Projects. Then you can "install" the website to your webserver.
Cleako
I just noticed another thing in your post. If you are going to want your classes in a DLLs separate from the main project then you need to create a class library and place all of your classes that you would like to keep separate in there and then just create instances of those classes within the library in the other project.
Cleako
As you suggested i created a class library. Then i made a file in some Namespace and put in a class. After building it i copied the dll from the bin folder to my sites bin folder. But still i couldnt use the class in my aspx pages. If i compile the same class through command line
vbc /t:library /out:MyClass.dll SomeClass.vb
then it works.
Moreover one of my classes had Imports System.Xml in it. when i build it, it works but when i use the above command line statement in the VS.net Command prompt i get an error saying the file couldnt be found. I dont know what to do and am stuck.
I tried adding the class library to my project, but still cant use it. How do other people generally implement code behind without using VS? I want to create classes in VS but use them in my aspx pages which i make in Dreamweaver.

Friday, March 16, 2012

Newbie Needs Help

So I am doing the walkthrough on the dynamic help for Visual Studio .net to create a read only data access in a web forms page.

I am coming up with an error and don't know how to fix it... Please help me!!!!

Server Error in '/ReadOnly' Application.
------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30180: Keyword does not name a type.

Source Error:

Line 31: <System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()> _
Line 32: Public Class Global_asax
Line 33: Inherits ReadOnly.Global
Line 34:
Line 35: Private Shared __initialized As Boolean = false

Source File: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\readonly\cc5ec6d7\7a0c1c27\-u9u0vh1.0.vb Line: 33Please provide code. This will help in determinig the problem...
the code for the page that I have written is

Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbCommand1 = New System.Data.OleDb.OleDbCommand
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Integrated Security=SSPI;Packet Size=4096;Data Source=018744S;Tag with column col" & _
"lation when possible=False;Initial Catalog=pubs;Use Procedure for Prepare=1;Auto" & _
" Translate=True;Persist Security Info=False;Provider=""SQLOLEDB.1"";Workstation ID" & _
"=018744S;Use Encryption for Data=False"
'
'OleDbCommand1
'
Me.OleDbCommand1.CommandText = "SELECT au_id, au_fname, au_lname, phone FROM authors"
Me.OleDbCommand1.Connection = Me.OleDbConnection1

End Sub
Protected WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Protected WithEvents OleDbCommand1 As System.Data.OleDb.OleDbCommand
Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
OleDbConnection1.Open()
Dim Reader As System.Data.OleDb.OleDbDataReader
Reader = OleDbCommand1.ExecuteReader()
DataGrid1.DataSource = Reader
DataGrid1.DataBind()
Reader.Close()
OleDbConnection1.Close()
End If
End Sub

Private Sub OleDbConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.OleDb.OleDbInfoMessageEventArgs) Handles OleDbConnection1.InfoMessage

End Sub
End Class

Newbie needs help!

Hi everyone,

I've got an xp Pro with IIS5.01 on it. I tried to create an ASP webapplication under VB.NET project but the IDE prompted 'VS.NET has detected the specific web server is not runing ASP.NET version 1.1. You will unable to use ASP.NET services or application.'

I do have .NET framwork 1.1, which came with the VS.NET 2003. I setup the VS.NET in another PC which has WIndows Server 2003 and IIS6.0 and it runs smoothly.

So I figure the problem is IIS or I could be wrong. Anyone can tell me how to upgrade IIS5.0 to 6.0 in XP Pro? I tried to do some research at microsoft website but no luck.

Any help will be appreciated.

TKSYou may try to run "aspnet_regiis.exe -i" from your .net framework 1.1 folder.
The .net framework 1.1 folder is most likely here:
C:\Windows\Microsoft.NET\Framework\v1.1.4322

You can goto start, run, type cmd
then change to the above directory & type: aspnet_regiis.exe -i
>Anyone can tell me how to upgrade IIS5.0 to 6.0 in XP Pro?

You can't. IIS 6.0 is an integrated part of Windows Server 2003; it cannot be installed on another OS.