|
Meanwhile I found the problem and fixed it. Since I'm sitting on an ubuntu computer and use VirtualBox to emulate Windows for .net development the problem where the network settings of the virtual machine.
Thanks for your help.
|
|
|
|
|
cool
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I have new interesting and weird information for you. Most of the bytes uploaded reach the Server and when the request times out or if I kill the client after some seconds (no difference) the bytes get written into the file and the picture looks like crap in the lower part. I tried it three times with the same pic which has 113919 bytes. On server side I once counted 113094 and twice 113318 bytes. For some reason those last bytes don't reach the server. I now hope wsdl.exe gave me a corrupt file, and I will create a new one. Since I don't really believe in that, more suggestions are welcome.
Edit:
I tried not using wsdl.exe and create a web reference in visual studio instead. Same problem like before.
Edit2:
I guess we are making process . Well, not really. After I found the following blog entry while searching the web for "asp.net webservice packet loss" I really thought that's it. But after I finished reading, I realized that there's no solution given at all. I started wireshark and I found these "tcp/ip retransmissions" as well, but still I have no clue what that's all about. By the way, I meanwhile moved to another server (new provider, more ram and cpu, fresh install) and nothing changed.
modified on Thursday, April 9, 2009 6:41 PM
|
|
|
|
|
Hello, I'm relatively new to c# and even newer to asp.net and ado.net.
I'm trying to improve my skills in the asp.net and ado.net areas.
I'm working on an a sample app where I want to display items in a web page based on what the user has selected from a drop-down list.
A couple of questions I have while on this learning path:
1 -Are all database queries and "presentation" done within the .aspx files, or are some done in the .cs files?
Thanks in advance.
---------
Jeff
|
|
|
|
|
Good question. In fact, your database queries SHOULD come from a seperate dll which encapsulates DB code. Microsoft have added ways to do database stuff in the ASPX, but no-one uses them except hobbyists and people who don't know/don't care about writing good code. You should run from any control that has you typing SQL into your aspx. You should try to wrap your database code into a seperate layer. Ideally, your database layer would not return database objects but take and return lists of classes in your project.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Jeff,
I like to break my design into three layers
1. Presentation
2. Business Logic
3. Database
1. In presentation layer I put only those that are of UI related. This will go directly into the aspx pages, user controls (usually I create on separate dll) and any UI related logic
2. Database. This is strictly database related classes. NO other code belongs here.
3. In business logic goes any middle-ware code that does not belong to any of the two categories.
Now, notice how I said 'This goes to separate dll' in the first case. I don't go crazy in creating many dlls. The rule of thumb I use is, if the code can be reused somewhere else, then I create it in its logical dll, so I can easily take it to another project and reused. That means the other layers may have multiple dlls as well.
Again, there are projects I have worked which they have only 2 layer or more than 3 layers. It does not have to be only 3 layers. The scope of the project will decide how you want to break your logical designs. In some cases you may be able to get away with single layer.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Christian, Yusuf, thanks for your timely and informative replies. I have 2 simple (hopefully) questions that come to mind based on your responses:
- You are both saying create separate .dlls. You do NOT mean the .cs files that are created in Visual Studio when you create a .aspx page, correct?
- I've been through a couple of "introductory" books on c# and they all seem to show the database access code occurring in the .aspx file. That figures if they're just trying to show you enough to get started. I'll poke around in codeproject a lot more but: what would be the best way you all recommend to learn to create web sites the right way, using .dlls?
Thanks again for your informative replies!
--
Jeff
|
|
|
|
|
jboyd111 wrote: You are both saying create separate .dlls. You do NOT mean the .cs files that are created in Visual Studio when you create a .aspx page, correct?
- The .cs files modularize your code. In most cases If the class is big enough I put it in one .cs files, but if the class is small, then I combine logical classes together.
- A dll is an assembly (or library) that contains certain functionality, for example Database layer
Most books in programming jump into the topic in discussion they throw everything in one place. The idea is to teach the language not necessarily the design. So, take it with grain of salt.
Here [^] are CP articles on design and strategy, should you need assistance don't hesitate to post your question in appropriate forum
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Thanks Yusuf. I knew what dlls vs source (.cs) files were, I just hadn't seen .dlls used in any of the web (.aspx) examples I came across. I'm still trying to find where the actual compiled code from my web projects go, but that's another thread.
Thanks for the pointer to the Design and Architecture articles and info. That should keep me busy for awhile
--------
Jeff
|
|
|
|
|
jboyd111 wrote: I'm still trying to find where the actual compiled code from my web projects go, but that's another thread.
Good question: In the case of dll you know where that goes.
In the case of asp.net, the compiled code gets copied into framework temp folder which is located in %WinDir%\Microsoft.Net\Framework\%version%\Temporary ASP.NET Files\%ProjectName%
where
%windir% = windows directory (by default in XP c:\windows)
%version% = Framework version (for example v2.0.50727)
%projectname% = asp.net project
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yusuf, my friend, you are my new hero! Thanks for taking the time to answer such rudimentary questions from a "newbie" such as myself.
---
Jeff
|
|
|
|
|
It was real pleasure helping people like you. Feel free to post any further question you may have in appropriate forum.
Good luck learning asp.net
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
So I've got a 3rd party application that I'm dealing with that has a menu system on the left side of the main page. We've embedded javascript to hide the items in the menu that we don't want the user to see (because of the way that the vendor implemented the application, we can't just remove markup, and have to do it via javascript). The script works fine if you open IE, and navigate to it. However, many of our users access the site through Citrix, and when the app comes up, the script doesn't appear to have run; the menu items we want hidden are still visible. However, refreshing the page suddenly seems to "wake up" the script, and the items disappear. To me, this seems like a timing issue, as though running from Citrix is somehow changing when the DOM load event is happening (the code is set up in a call to window.attachEvent('onload', function(){...}); ).
Has anybody else ever seen this behavior, and if so, how did you fix it?
Thanks in advance.
|
|
|
|
|
Jamie Nordmeyer wrote: window.attachEvent('onload', function(){...}); ).
I have seen many issues with onload . In some browsers it appears that it gets fired before the DOM completes loading. This issue can be easily fixed with JQuery[^]
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hey Yusuf. Thanks for the reply. Trust me, I know all about jQuery. I'm the guy who got it adopted at work. Unfortunately, the code I'm talking about is generated dynamically by ASP code in a 3rd party application where I work. We've actually done some research today, and it's related to how the Citrix servers were set up, though we don't know the full details yet. I'll post the results here when I find out.
|
|
|
|
|
Hello.
I am trying to make my own (freeware) Rapidshare downloader in C# and I need a way to do the button press simulation (for the "Free User" button on the rapidshare page). Below is the HTML code for the 2 available buttons (free & premium). Right now, I am using a WebClient to get the HTML page and I 've read on the net that I must make an http Request for the link placed in the value of action . However this is not enough (I return to the same page). I guess I must use the HttpWebRequest , the action="..." and the id="ff" to make it work. Can anyone tell me how exactly (because I have no idea yet... ) ?
(I mean... where do I put the id )
I 've found this: How to use HttpWebRequest and HttpWebResponse in .NET[^] but should I put the id in the webrequest.Headers like that (?):
webrequest.Headers.Add("id", "ff"); ???
</script>
<h1>FILE DOWNLOAD</h1>
<div class="klappbox">
<p class="downloadlink">http:
<center>
<table>
<tr valign="top">
<td width="300" style="text-align:center;">
<form id="ff" action="http://rs764.rapidshare.com/files/20600000/a.rar" method="post">
<input type="hidden" name="dl.start" value="Free" />
<img src="/img2/dl_langsam.gif">
<br />
<input type="submit" value="Free user" />
</form>
<script type="text/javascript">
<!--
if (window.location.hash == "#dlt")
document.getElementById("ff").action += "#dlt";
</script>
</td>
<td width="300" style="text-align:center;">
<form action="http://rs764.rapidshare.com/files/20600000/a.rar" method="post">
<input type="hidden" name="dl.start" value="PREMIUM" />
<img src="/img2/dl_schnell.gif" />
<br />
<input type="submit" value="Premium user" />
</form>
</td>
</tr>
</table>
</center>
...
I hope I've chosen the right forum to post this.
Thanks.
Konstantinos
modified on Wednesday, April 8, 2009 3:44 PM
|
|
|
|
|
On second review, it seems that Rapidshare is well protected so that download-manager-makers have a hard time... Perhaps I should post a question here : http://www.hackforums.net[^]
kostas KEL
|
|
|
|
|
You are trying to second guess rapidshare ( for that matter any other site ). What happens if they change they page or controls? you code will be easily broken.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yes. That is a problem. However, if I learn how to do it once, then I could do it easier and faster the next time(s). And in the process of trying, I will learn new things.
As a poet would say (I don't like poetry by the way...) it's more about the journey, not the destination.
kostas KEL
|
|
|
|
|
Greetings...
I'm currently working with IIS 5.1, developing a web app using C#, and testing on win xp pro. One of the functions of the web app is to map a drive letter to a network resource. The way I'm going about this is calling a batch file from the application:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = @"C:\tmp\testBat.bat";
proc.Start();
The batch file contains the following:
copy "C:\tmp\src\test.txt" "C:\tmp\dst\testcopy4.txt"
net use X: <some network="" resource="" path="">
I've setup impersonation in web.config, and am only using Integrated Windows Authentication in the web app. I also mapped the .bat extension to cmd.exe. When I click the button that's associated with calling the batch file, I can see that the file copy works, but nothing happens with the drive mapping command. (this is accomplished by checking whether the directory exists elsewhere in the code).
Any ideas? I hope I posted this to the right place. I'm wondering if it has something to do the particular executable...
|
|
|
|
|
alchong wrote: net use X:
Well do you have drive X mapped?
what do get if run net use command
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Hi Yusuf,
I didn't realize that the rest of the "net use X:" line got hidden because the editor thought it was html because I placed it between brackets. What I meant to say is:
net use X: <some network resource path>
I didn't review my post closely enough. Apologies!
and update of my troubleshooting, when I look at the task manager on my computer, I see that when the batch file executes, cmd.exe and net.exe run under the ASPNET user name. I'm not sure why this is, since I set up impersonation, perhaps I'm missing something in my configuration?
modified on Thursday, April 9, 2009 12:03 PM
|
|
|
|
|
what do you get if you run your batch file manually on the server.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
When I run the batch file manually it works. Also I edited my last message, but if you didn't catch it, when the batch runs from the web application, I noted that cmd.exe and net.exe run under the ASPNET user name, and do not seem to terminate. Is this something to do with my configuration? I thought I setup impersonation properly.
|
|
|
|
|
alchong wrote: I noted that cmd.exe and net.exe run under the ASPNET user name, and do not seem to terminate.
You need to set the flag to terminate the command window. I don't remember since it has been very long time. run cmd /? and you will figure it out.
alchong wrote: Is this something to do with my configuration? I thought I setup impersonation properly.
I don't know. may be asp.net account can not perform network actions. again this is a guess, I have no proof for that.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|