我有一个 Azure 函数,我正在尝试将 .xlsx 文件保存到临时文件夹中。我的代码在本地运行,但是当我发布到 Azure 时,我收到一条错误消息。
string projectDirectory = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName + @"\temp\";
string tempFilename = "abc.xlsx";
string pathTradeRecFile = Path.Combine(projectDirectory, tempFilename);
Run Code Online (Sandbox Code Playgroud)
我的错误信息。<--- 访问路径“C:\Program Files (x86)\SiteExtensions\temp\abc.xlsx”被拒绝。
有人可以告诉我如何将此文件保存在某处吗?我在我的结构中创建了一个名为“temp”的文件夹作为一种可能的解决方案,但我似乎无法访问它。
任何帮助将不胜感激!!
在我的Xamarin.Forms项目中,我有一个包含2行3列的网格。在第1行中,我有一个标签,在第2行中,我有一个垂直的Stackpanel。标签和堆栈面板之间似乎有很大的空间,如何移除此垫片?
我试过使用rowspacing = 0,但无法正常工作。有任何想法吗?
如果我移除了堆栈面板,而只是在不同的行中使用了标签,那么该空间将被移除...但是我想保留堆栈面板
这是代码...
<Grid Grid.Row="1" Grid.Column="0" RowSpacing="0"
Margin="5"
BackgroundColor="{StaticResource backgroundColorWhite}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" HorizontalOptions="Start"
Margin="5,5,0,0"
Text="{Binding MyUserSelections.SelectedClientName}"
TextColor="{StaticResource textColorBlack}"
FontSize="16"
FontAttributes="Bold"/>
<StackLayout Grid.Row="1" Grid.Column="0"
Orientation="Vertical"
Padding="0"
Margin="5,0,0,5"
Spacing="0">
<... elements .../>
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="1"
Padding="0"
Margin="0,0,0,5"
Spacing="0"
Orientation="Vertical"
HorizontalOptions="CenterAndExpand" >
<... elements .../>
</StackLayout>
<StackLayout Grid.Row="1" Grid.Column="2"
Padding="0"
Margin="0,0,5,0"
Spacing="0"
Orientation="Vertical"
HorizontalOptions="End" >
<... elements .../>
</StackLayout>
</Grid>
Run Code Online (Sandbox Code Playgroud) 我正在尝试将excel文件及其内容上传到我的WebApi和DO STUFF。我已经完成了通过上传按钮发送文件的extJs部分。(下面的代码)
我的问题是我不知道如何构建webApi部分来处理excel文件。我猜我必须有一个HttpPost。
假WebApi:
public string SampleUploadFile()
{
return _repo.UploadFile();
}
Run Code Online (Sandbox Code Playgroud)
Extjs代码:
xtype: 'form',
//renderTo: 'fi-form', //(5)
fileUpload: true, //(1)
width: 500,
frame: true,
title: 'Position Sheet Upload Form',
bodyPadding: '10 10 0',
//bodyStyle: 'padding: 10px 10px 0 10px;',
defaults: {
anchor: '100%',
allowBlank: false,
msgTarget: 'side',
labelWidth: 50
},
//labelWidth: 50,
items: [{
xtype: 'fileuploadfield',
emptyText: 'Select an image',
fieldLabel: 'Image',
name: 'file', //(2)
buttonText: 'Choose a file'
}],
buttons: [{
text: 'Save',
handler: function () {
if (this.up('form').getForm().isValid()) …Run Code Online (Sandbox Code Playgroud) 我收到错误,我确信这是由于打字稿造成的。这是我试图开始工作的一个例子。我使用js服务器导入一些笔记。该错误是 NoteCard.tsx 文件中 {note} 下的一条红线。有人可以帮助我了解如何使用这些属性吗?
这是我的 notecard.tsx
export default function NoteCard({ note }) { return <div>{note.title}</div>;}
Run Code Online (Sandbox Code Playgroud)
这是我的笔记.tsx
export default function Notes() {
const [notes, setNotes] = useState<any[]>([]);
useEffect(() => {
fetch("http://localhost:8000/notes")
.then((res) => res.json())
.then((data) => setNotes(data));
}, []);
return (
<Container>
<Grid container>
{notes.map((note) => (
<Grid item key={note.id} xs={4} md={4} lg={4}>
<NoteCard note={note} />
{/* <Paper>{note.title}</Paper> */}
</Grid>
))}
</Grid>
</Container>
);
}
Run Code Online (Sandbox Code Playgroud) 我试过像这样制作一个extjs全局变量类:
Ext.define('ccc.global.GlobalVariables', {
singleton: true,
username: 'hi user',
password: '',
clientID: '',
token: ''
});
Run Code Online (Sandbox Code Playgroud)
然后在控制器中我尝试更改变量,如下所示:
ccc.global.GlobalVariables.username = loginData.username;
Run Code Online (Sandbox Code Playgroud)
现在我试图在不同的模型代理中访问这些变量,并且它不断返回原始值'hi user'.
proxy: {
type: 'ajax',
extraParams: {
'username': ccc.global.GlobalVariables.username
},
Run Code Online (Sandbox Code Playgroud)
有谁看到我做错了什么?
我试图Authorization: 'Bearer <TOKEN>'通过参数传入标题到我的store.load(),它不起作用.
如果我这样做,它的工作原理如下:
Ext.define('ExtApplication4.model.MenuListModel', {
extend: 'ExtApplication4.model.Base',
requires: [
'ExtApplication4.model.Base'
],
fields: [
{
name: 'text',
type: 'string'
},
{
name: 'iconCls',
type: 'string'
},
{
name: 'className',
type: 'string'
}
],
proxy: {
type: 'ajax',
url: 'http://xxxxx/xxx/api/user/getusermenus/',
reader: {
type: 'json',
rootProperty: 'data'
},
headers: {
Authorization: 'Bearer ' + Ext.decode(Ext.util.Cookies.get('token'))
}
}
});
Run Code Online (Sandbox Code Playgroud)
问题是我想填充我的授权标题store.load().我花了好几个小时试图找到这样做的语法.我尝试标题的所有内容都没有添加.
有人能告诉我怎么做吗?
这是我试过的:
targetStore.load({
params: {
username: uname
},
//headers: {
// Authorization: 'Bearer ' + token;
//}, …Run Code Online (Sandbox Code Playgroud)