|
It doesn't seem to be there in IIS. See pic
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
No, you've double-clicked on "Handler Mappings", not "Feature Delegation".
NB: "Feature delegation" is only available at the root, when you click on the server name. It won't be available within a specific site or application.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yup, I was wrong. Found it now.
Thanks!
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Hello,
This is my program with the obsolete WebRequest.
Who will help me to set this up with HttpClient.
Thanks in advance, Ger
public ToProgModel ProgCsv(Uri webSiteProg, ToProgModel prog, string complexProg)
{
string ProgTextString;
try
{
var AuthorisatorProg = _config.GetConnectionString("AuthorisatorProg");
var PasswordProg = _config.GetConnectionString("PasswordProg");
#pragma warning disable SYSLIB0014 // Type or member is obsolete
WebRequest webrequest = WebRequest.Create(webSiteProg);
#pragma warning restore SYSLIB0014 // Type or member is obsolete
SetBasicAuthHeader(webrequest, AuthorisatorProg, PasswordProg);
WebResponse webresponse = webrequest.GetResponse();
Stream webstream = webresponse.GetResponseStream();
StreamReader streamreader = new(webstream);
ProgTextString = streamreader.ReadToEnd();
webresponse.Close();
webresponse.Dispose();
streamreader.Dispose();
webstream.Dispose();
}
catch (HttpRequestException ex)
{
prog.Ret = $"Http response EX: {ex.Message}";
return null;
}
return prog;
}
public void SetBasicAuthHeader(WebRequest request, string userName, string userPassword)
{
string authInfo = userName + ":" + userPassword;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
request.Headers["Authorization"] = "Basic " + authInfo;
}
|
|
|
|
|
For a start, you'll need to make your method async to use the HttpClient class. Which unfortunately means you'll need to make the calling method async , and so on - it's async all the way down.
At the basic level, your code would look something like this:
public async Task<ToProgModel> ProgCsvAsync(Uri webSiteProg, ToProgModel prog, string complextProg)
{
HttpClient client = new HttpClient();
SetBasicAuthHeader(client.DefaultRequestHeaders, AuthorisatorProg, PasswordProg);
using (HttpResponseMessage response = await client.GetAsync(webSiteProg))
{
if (!response.IsSuccessStatusCode)
{
prog.Ret = $"Http response EX: {response.StatusCode}";
return null;
}
string progTextString = await response.Content.ReadAsStringAsync();
...
return prog;
}
}
public void SetBasicAuthHeader(HttpRequestHeaders headers, string userName, string userPassword)
{
string authInfo = userName + ":" + userPassword;
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
headers.Authorization = new AuthenticationHeaderValue("Basic", authInfo);
} There are several improvements you can make to this - for example, using IHttpClientFactory[^] to manage the HttpClient instances.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi Homer, thanks for your response. But I don't see in IHttpClientFactory how to implement "Http Basic Authentication"
So as in my source "
SetBasicAuthHeader(webrequest, AuthorisatorProg, PasswordProg); "
|
|
|
|
|
I included an updated version of that method in my answer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sorry Richard,
I had mist in the first moment your update, only see your phrase from Homer.
But now I need to give you many thanks for your UPDATE on my program.
I have installed your update and every thing works nice.
Thank you very much en best regards Ger
|
|
|
|
|
Hi, please pretty much new to web development, I recently developed a little e-commerce website using Node js, express for the backend, and plain HTML and CSS for the front-end. Can anyone help me with a guide on how to take this site to production?
|
|
|
|
|
Choose a web host that has been around for at least 15 or 20 years and contact them and ask them how to get this started. You should get your own dot com and start with the MINIMUM setup that the web host will allow. Then work with the site (your own dot com) for at least 30 days so that you have forced yourself to not rush into it and you have some experience watching the results of your choices.
Do NOT spend a lot of money on options at the web host. Almost everything that they offer to you for money: you can probably do yourself. Except things like getting an SSL certificate, do that after 30 days and pay for it.
Thank you for asking.
|
|
|
|
|
I have pairs of images and their related texts in my web application. My images are small rounded photos that the user can click on each of them to enter a new page. I want to place their specified texts at the center of those thumbnails.
I wrote these codes:
<html lang="fa">
<head>
<title>Information System</title>
<style>
#main-image{
display: block;
margin-left: auto;
margin-right: auto;
max-width: 100%;
max-height: auto;
}
b{
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
color: blue;
}
.sub-image{
border-radius: 5%;
}
.container{
position: relative;
text-align: center;
}
</style>
</head>
<body bgcolor="white">
<div>
<img id="main-image" src="Images/IT.jpg" width="1600" alt="Intro">
</div>
<hr>
<div class="container">
<img class="sub-image" src="Images/repair.jpg" width="300">
<div class="image-text">
Failures
</div>
</div>
<div class="container">
<img class="sub-image" src="Images/Equipment.jpg" width="300">
<div class="image-text">
Equipments
</div>
</div>
</body>
</html>
Please help me.
modified 21-Jul-21 14:01pm.
|
|
|
|
|
Hey you have to write these css code to make text appear over the image and center .
.image-text{position:absolute; top:50%; left:0; width:100%; z-index:10; text-align:center; transform:translateY(-50%);}
You can keep you css as it is.. just paste above css and your text will be over and center. let me know if it work for you.
|
|
|
|
|
|
Message Closed
modified 28-Jul-21 7:49am.
|
|
|
|
|
|
I recently got this at the NY Times website.
|
|
|
|
|
|
|
I have a Idea for general problem solving of the people. I can not share it here in detail. but the functionality as similar OLA.
which Technology I should prefer ?
How much Time will be taken
Budget Also
|
|
|
|
|
In my thought, it's depend on client demand. Nowadays, lots of template code is existing and similar code is selling on Envato, you can check code and can pay for it.
|
|
|
|
|
There is no way to give a specific answer without knowing the details of the app.
1. Which Technology? The one that can handle what you need and are most familiar with.
2. How much time will be taken? How do you think we can answer that?
3. Again, you have given no details so how can we possibly answer any of these questions?
|
|
|
|
|
I am needing to import excel data into my program. I am using Visual Studio 2019 web development and my code behind runs VB.
I would like to load data into gridview and from there into sql. I have a lot of work to do to clean up the data before my final product is ready. So I am wiring a routing to clean up the data.
Anyone have an idea. I have been searching online but most of the options does not work. If you have the answer please also provide me with the imports statements I need.
|
|
|
|
|
It is not clear what your actual problem is, but importing from Excel is fairly painless in .NET. You just need to use the Microsoft.Office.Interop.Excel Namespace | Microsoft Docs[^]. Google will find you sample code.
[edit]
As @RichardDeeming points out below, you cannot do this in a web application. But you could do it offline if that is an option.
[/edit]
modified 19-May-21 4:03am.
|
|
|
|
|
You can't use Excel interop in a web application.
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Do you ever find that someone unplugged your brain while you were asleep?
TBH I missed the two key words.
|
|
|
|